Exemplo n.º 1
0
    private void Start()
    {
        base.Initial();
        Animator animator;

        animator = GetComponent <Animator>();

        #region 设置角色控制器的大小
        control        = GetComponent <CharacterController>();
        control.center = new Vector3(0, 1, 0);
        control.height = 2;
        control.radius = 0.23f;
        #endregion

        #region 添加动画
        PlayerIdel playerIdel = new PlayerIdel(animator);
        fsmManager.AddState(playerIdel);
        PlayerWalk playerWalk = new PlayerWalk(animator);
        fsmManager.AddState(playerWalk);
        PlayerRun playerRun = new PlayerRun(animator);
        fsmManager.AddState(playerRun);
        PlayerAttack playerAttack = new PlayerAttack(animator);
        fsmManager.AddState(playerAttack);
        PlayerAttacked playerAttacked = new PlayerAttacked(animator, this);
        fsmManager.AddState(playerAttacked);
        PlayerDie playerDie = new PlayerDie(animator);
        fsmManager.AddState(playerDie);
        #endregion
    }
Exemplo n.º 2
0
    void Start()
    {
        m_param = GetComponent <PlayerParam>();
        // m_param.Target.transform.position = new Vector3(1.0f, 0.5f, 1.0f);

        m_idel       = m_IdelObj.GetComponent <PlayerIdel>();
        m_move       = m_MoveObj.GetComponent <PlayerMove>();
        m_end        = m_EndObj.GetComponent <PlayerEnd>();
        m_controller = GetComponentInChildren <MouseController>();
    }