예제 #1
0
 public bool PlayWorldAnimation(Facepunch.Movement.GroupEvent GroupEvent)
 {
     if (this._characterSignalee)
     {
         PlayerAnimation component = this._characterSignalee.GetComponent <PlayerAnimation>();
         if (component)
         {
             return(component.PlayAnimation(GroupEvent));
         }
     }
     return(false);
 }
예제 #2
0
    public bool PlayAnimation(Facepunch.Movement.GroupEvent GroupEvent, float animationSpeed, float animationTime)
    {
        AnimationState animationState;
        bool           flag;

        if (this.movement == null)
        {
            Debug.Log("no Movement");
            return(false);
        }
        try
        {
            if (this.movement.GetGroupEvent(GroupEvent, out animationState))
            {
                if (animationTime >= 0f)
                {
                    animationState.normalizedTime = animationTime;
                }
                else
                {
                    animationState.time = -animationTime;
                }
                if (!this.animation.Play(animationState.name, PlayMode.StopSameLayer))
                {
                    return(false);
                }
                if (animationState.speed != animationSpeed)
                {
                    animationState.speed = animationSpeed;
                }
                return(true);
            }
            else
            {
                flag = false;
            }
        }
        catch (NotImplementedException notImplementedException)
        {
            Debug.LogException(notImplementedException, this);
            flag = false;
        }
        return(flag);
    }
예제 #3
0
 public bool PlayAnimation(Facepunch.Movement.GroupEvent GroupEvent)
 {
     return(this.PlayAnimation(GroupEvent, 1f, 0f));
 }
예제 #4
0
 public bool PlayAnimation(Facepunch.Movement.GroupEvent GroupEvent, float animationSpeed)
 {
     return(this.PlayAnimation(GroupEvent, animationSpeed, 0f));
 }