public void OnEnter() { _curAnim = Const.ANIMATION.IDLE; _fsm.animationFinished += OnAnimationFinished; _animState = new AnimStateModel(_fsm.animStateObj); _animState.Subscribe(OnAnimStateChanged); }
private void AddAnimation(Const.ANIMATION key, string animation) { var success = _animController.AddAnimation((int)key, animation); if (!success) { Logger.Error("Cant add animation, key:" + key.ToString()); } }
private void Run(float moveX, float moveZ) { if (moveZ != 0) { _curAnim = moveZ > 0 ? Const.ANIMATION.RUN_FW : Const.ANIMATION.RUN_BW; } else if (moveX != 0) { _curAnim = moveX > 0 ? Const.ANIMATION.RUN_RIGHT: Const.ANIMATION.RUN_LEFT; } _character.MoveSpeed = Const.RunSpeed; }
private void Walk(float moveX, float moveZ) { if (moveZ != 0) { _curAnim = moveZ > 0 ? Const.ANIMATION.WALK_FW : Const.ANIMATION.WALK_BW; } else if (moveX != 0) { _curAnim = moveX > 0 ? Const.ANIMATION.WALK_RIGHT: Const.ANIMATION.WALK_LEFT; } _character.MoveSpeed = Const.WalkSpeed; }
public void ChangeAnimation(Const.ANIMATION key) => _animState.CurAnimation = (int)key;
private void FireballSmall() { _isAnimationPlaying = true; _curAnim = Const.ANIMATION.ATTACK_FIREBALL_SMALL; }
private void FireballBig() { _isAnimationPlaying = true; _curAnim = Const.ANIMATION.ATTACK_FIREBALL_BIG; }