public override void Init() { base.Init(); _con = GetComponent <Sentry_controller>(); _con.Init(this); }
public virtual void Init(Enemy owner) { _owner = owner; _con = _owner.GetComponent <Sentry_controller>(); _anim = owner.GetComponent <Animator>(); //owner의 Animator를 가져옴 GameObject playerObj = GameManager.Instance._player; _player = playerObj.GetComponent <Char2D>(); Debug.Log("스테이트 초기화 :" + GetType().ToString()); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) //{ // //} // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) //{ // //} // OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { Sentry_controller sentry = animator.GetComponent <Sentry_controller>(); sentry.ChangeState(AIStateID.IDLE); //공격모션이 끝아면idle로 }