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); }
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(); } } }
public void StartRuning() { this.onGround = true; this.currentState = SpiderAnimationState.RUN; }
public void StartJump() { this.currentState = SpiderAnimationState.JUMP; this.jumpForceApplied = false; }
public void StartIdle() { this.currentState = SpiderAnimationState.IDLE; }
public void StartActivation() { this.currentState = SpiderAnimationState.ACTIVATION; }