public class AnimationSynchronizable : AttributesSyncusing UnityEngine;
[RequireComponent(typeof(Alteruna.AnimationSynchronizable))]
public class MyAnimatedObj : MonoBehaviour
{
private Alteruna.AnimationSynchronizable _aniSync;
// We can optimize by precalculating the hash of the animation state.
private int JumpId = Animator.StringToHash("Jump");
private void Start()
{
_aniSync = GetComponent<Alteruna.AnimationSynchronizable>();
// We can get the Unity Animator from the AnimationSynchronizable component.
if (_aniSync.Animator.isHuman) print("Humanoid");
}
private void Update()
{
// Play animation
if (Input.GetKeyDown(KeyCode.Space))
{
// play for all clients
_aniSync.Play(JumpId);
}
}
}| AnimatorUpdate | |
| Play(Int32) | |
| Play(String) | |
| Play(Int32, Int32) | |
| Play(String, Int32) | |
| Play(Int32, Int32, Single) | |
| Play(String, Int32, Single) | |
| Rebind | |
| Reset | |
| ResetTrigger(Int32) | |
| ResetTrigger(String) | |
| SetBool(Int32, Boolean) | |
| SetBool(String, Boolean) | |
| SetFloat(Int32, Single) | |
| SetFloat(String, Single) | |
| SetInteger(Int32, Byte) | |
| SetInteger(Int32, Int32) | |
| SetInteger(String, Byte) | |
| SetInteger(String, Int32) | |
| SetLayerWeight(Int32, Single) | Sets the weight of the layer at the given index. |
| SetLayerWeight(Int32, Single, Single) | Sets the weight of the layer at the given index but only if equal or above the required delta. |
| SetLookAtPosition | |
| SetTarget | |
| SetTrigger(Int32) | |
| SetTrigger(String) | |
| StartPlayback | |
| StopPlayback |
| Animator | |
| OnlyCommitNewStates | If true, only commit new states in SetBool, SetInteger, and SetFloat methods. |