Exemplo n.º 1
0
        private void ConfigureState(SpiderAnimationState animationState, string clipName, Action action = null)
        {
            SpiderAnimationEntry entry = new SpiderAnimationEntry {
                ClipName  = clipName,
                Animation = this.animation[clipName],
                Action    = action
            };

            this.states.Add(animationState, entry);
        }
Exemplo n.º 2
0
 private void FixedUpdate()
 {
     this.AddStabilizeForce();
     if (this.states.ContainsKey(this.currentState))
     {
         if (this.oldState != this.currentState)
         {
             this.animation.CrossFade(this.states[this.currentState].ClipName);
             this.oldState = this.currentState;
             this.states[this.currentState].StartTime = Time.timeSinceLevelLoad;
         }
         if (this.states[this.currentState].Action != null)
         {
             this.states[this.currentState].Action();
         }
     }
 }
Exemplo n.º 3
0
 public void StartRuning()
 {
     this.onGround     = true;
     this.currentState = SpiderAnimationState.RUN;
 }
Exemplo n.º 4
0
 public void StartJump()
 {
     this.currentState     = SpiderAnimationState.JUMP;
     this.jumpForceApplied = false;
 }
Exemplo n.º 5
0
 public void StartIdle()
 {
     this.currentState = SpiderAnimationState.IDLE;
 }
Exemplo n.º 6
0
 public void StartActivation()
 {
     this.currentState = SpiderAnimationState.ACTIVATION;
 }