Class SpineInstance
- Namespace
- AO
- Assembly
- CoreAssembly.dll
Backing instance of a spine skeleton. See SpineSkeletonAsset.
public class SpineInstance
- Inheritance
-
SpineInstance
- Inherited Members
- Extension Methods
Fields
_onEventExt
public Action<string, int, float, string> _onEventExt
Field Value
Properties
ColorMultiplier
Color multiplier to use when rendering.
public Vector4 ColorMultiplier { get; set; }
Property Value
Scale
Get/set the scale of the spine instance
public Vector2 Scale { get; set; }
Property Value
Speed
Animation speed of the spine instance.
public float Speed { get; set; }
Property Value
SpineAsset
Get the skeleton for the spine instance
public SpineSkeletonAsset SpineAsset { get; }
Property Value
StateMachine
Get the state machine for the spine instance
public StateMachine StateMachine { get; }
Property Value
Methods
Create()
Create a new spine instance
public static SpineInstance Create()
Returns
Destroy()
Destroy the spine instance
public void Destroy()
DisableAllSkins()
Disable all skins for the spine instance
public void DisableAllSkins()
Remarks
You must call RefreshSkins after this to see the changes
DisableSkin(string)
Disable a skin for the spine instance
public bool DisableSkin(string skin)
Parameters
skin
string
Returns
Remarks
You must call RefreshSkins after this to see the changes
EnableSkin(string)
Additively enable a skin for the spine instance
public bool EnableSkin(string skin)
Parameters
skin
string
Returns
Remarks
You must call RefreshSkins after this to see the changes
GetBonePosition(string)
public Vector2 GetBonePosition(string bone)
Parameters
bone
string
Returns
GetSkins()
public string[] GetSkins()
Returns
- string[]
Make()
Create a new spine instance
[Obsolete("Use Create(). In the All Out APIs, a Create() function implies a Destroy() function. If you call Create() without calling a Destroy() then you are leaking memory if that ownership isn't transferred somewhere else as in SpineIntance.SetStateMachine() or Sprite_Renderer.SetMaterial(). This will become an error in proto 40.")]
public static SpineInstance Make()
Returns
RefreshSkins()
Refresh the skins for the spine instance.
public void RefreshSkins()
SetAnimation(string, bool, int, float)
Set the animation for the spine instance
public bool SetAnimation(string animation, bool loop, int track = 0, float speed = 1)
Parameters
Returns
SetBonePosition(string, Vector2)
public void SetBonePosition(string bone, Vector2 position)
Parameters
SetSkeleton(SpineSkeletonAsset)
Set the skeleton for the spine instance
public void SetSkeleton(SpineSkeletonAsset asset)
Parameters
asset
SpineSkeletonAsset
SetSkin(string)
Disable all other skins and set this one
public bool SetSkin(string skin)
Parameters
skin
string
Returns
Remarks
You must call RefreshSkins after this to see the changes
SetStateMachine(StateMachine, Entity)
Set the state machine for the spine instance
[Obsolete("Use SetStateMachine(StateMachine sm, bool transferOwnership). If you were passing a valid 'owner' before, pass 'true' to the new overload. If you were passing 'null' before, pass 'false'. This will become an error in proto 40.")]
public void SetStateMachine(StateMachine sm, Entity owner)
Parameters
sm
StateMachineowner
Entity
SetStateMachine(StateMachine, bool)
Set the state machine for the spine instance If transferOwnership is true, then the spine instance will destroy the state machine when it itself is destroyed. If transferOwnership is false, then the destruction of the state machine is not the spine instances's responsibility and you will destroy it.
public void SetStateMachine(StateMachine sm, bool transferOwnership)
Parameters
sm
StateMachinetransferOwnership
bool
SetTransformConstraintPosition(string, Vector2)
Set the position of a transform constraint
public void SetTransformConstraintPosition(string name, Vector2 value)
Parameters
SetTransformConstraintRotation(string, float)
Set the rotation of a transform constraint
public void SetTransformConstraintRotation(string name, float value)
Parameters
SetTransformConstraintScale(string, Vector2)
Set the scale of a transform constraint
public void SetTransformConstraintScale(string name, Vector2 value)
Parameters
TrySetToPlayerRig(string, Player)
Attempts to find a player rig (as defined in Edit -> Game Config) that matches rigName.
public bool TrySetToPlayerRig(string rigName, Player player)
Parameters
Returns
Update(float)
Update the spine instance. Usually called every frame
public void Update(float dt)
Parameters
dt
float
Events
OnAnimationEnd
public event Action<string> OnAnimationEnd
Event Type
OnAnimationStart
public event Action<string> OnAnimationStart
Event Type
OnEvent
public event Action<string> OnEvent
Event Type
OnEventExt
public event Action<string, int, float, string> OnEventExt