mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-18 03:09:45 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
57 lines
1.2 KiB
C#
57 lines
1.2 KiB
C#
using Sandbox;
|
|
|
|
/// <summary>
|
|
/// Hidden class. addon code should only ever access MorphCollection.
|
|
/// </summary>
|
|
internal sealed class SceneObjectMorphCollection : MorphCollection
|
|
{
|
|
readonly SceneModel Target;
|
|
|
|
public SceneObjectMorphCollection( SceneModel sceneObject )
|
|
{
|
|
Target = sceneObject;
|
|
}
|
|
|
|
public override void ResetAll()
|
|
{
|
|
Target.animNative.SBox_ClearFlexOverride();
|
|
}
|
|
|
|
public override void Reset( int i )
|
|
{
|
|
Target.animNative.SBox_SetFlexOverride( i, 0.0f );
|
|
}
|
|
|
|
public override void Reset( string name )
|
|
{
|
|
Target.animNative.SBox_SetFlexOverride( name, 0.0f );
|
|
}
|
|
|
|
public override void Set( int i, float weight )
|
|
{
|
|
Target.animNative.SBox_SetFlexOverride( i, weight );
|
|
}
|
|
|
|
public override void Set( string name, float weight )
|
|
{
|
|
Target.animNative.SBox_SetFlexOverride( name, weight );
|
|
}
|
|
|
|
public override float Get( int i )
|
|
{
|
|
return Target.animNative.SBox_GetFlexOverride( i );
|
|
}
|
|
|
|
public override float Get( string name )
|
|
{
|
|
return Target.animNative.SBox_GetFlexOverride( name );
|
|
}
|
|
|
|
public override string GetName( int index )
|
|
{
|
|
return Target.Model.GetMorphName( index );
|
|
}
|
|
|
|
public override int Count => Target.Model.MorphCount;
|
|
}
|