Esempio n. 1
0
        public KnightASM(Animator animator, KnightVO vo)
        {
            Animator = animator;
            _vo      = vo;

            ActionTagHash = Animator.StringToHash("Action");
            Idle1Hash     = Animator.StringToHash("Base Layer.Idle.Idle1");
            WalkHash      = Animator.StringToHash("Base Layer.Move.Walk");
            RunHash       = Animator.StringToHash("Base Layer.Move.Run");
            AttackHash    = Animator.StringToHash("Base Layer.Action.Attack");
            BlockIdleHash = Animator.StringToHash("Base Layer.Action.BlockIdle");
            BlockHash     = Animator.StringToHash("Base Layer.Action.Block");
        }
Esempio n. 2
0
        protected override void OnInit()
        {
            VO  = new KnightVO();
            FSM = new FiniteStateMachine <EKnightState>();
            ASM = new KnightASM(GetComponent <Animator>(), VO);
            CC  = GetComponent <CharacterController>();

            _stateDic[EKnightState.IDLE]    = new KnightIdleStateController(this);
            _stateDic[EKnightState.MOVE]    = new KnightMoveStateController(this);
            _stateDic[EKnightState.ATTACK]  = new KnightAttackStateController(this);
            _stateDic[EKnightState.DEFENCE] = new KnightDefenceStateController(this);
            FSM.SwitchState(EKnightState.IDLE);
        }