Ejemplo n.º 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);
 }
Ejemplo n.º 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);
    }
Ejemplo n.º 3
0
 public bool PlayAnimation(Facepunch.Movement.GroupEvent GroupEvent)
 {
     return(this.PlayAnimation(GroupEvent, 1f, 0f));
 }
Ejemplo n.º 4
0
 public bool PlayAnimation(Facepunch.Movement.GroupEvent GroupEvent, float animationSpeed)
 {
     return(this.PlayAnimation(GroupEvent, animationSpeed, 0f));
 }