예제 #1
0
파일: Enemy.cs 프로젝트: kimha578/dduk
    public virtual void Change(EnemystateMachine nextState)
    {
        if (currentState == nextState)
        {
            return;
        }
        switch (currentState)
        {
        case EnemystateMachine.Idle:
            m_Idle.Exit(this.gameObject);
            break;

        case EnemystateMachine.Move:
            m_Move.Exit(this.gameObject);
            break;

        case EnemystateMachine.Attack:
            m_Attack.Exit(this.gameObject);
            break;

        case EnemystateMachine.Death:
            m_Death.Exit(this.gameObject);
            break;
        }
        currentState = nextState;
        switch (currentState)
        {
        case EnemystateMachine.Idle:
            m_Idle.Enter(this.gameObject);
            break;

        case EnemystateMachine.Move:
            m_Move.Enter(this.gameObject);
            break;

        case EnemystateMachine.Attack:
            m_Attack.Enter(this.gameObject);
            break;

        case EnemystateMachine.Death:
            m_Death.Enter(this.gameObject);
            break;
        }
    }
예제 #2
0
 public override void Change(EnemystateMachine nextState)
 {
     base.Change(nextState);
 }
예제 #3
0
파일: Enemy.cs 프로젝트: kimha578/dduk
 // Use this for initialization
 protected virtual void Awake()
 {
     m_Idle.Enter(this.gameObject);
     currentState = EnemystateMachine.Idle;
     rb           = GetComponent <Rigidbody>();
 }