void Start() { // 设置ID SetID(++EntityManager.lastEntityID); //设置状态接口,并指向一个状态 PeopleAC = gameObject.GetComponent <LocomotionPeople>(); EntityManager.Instance().RegisterEntity(this); States = this.gameObject.transform.FindChild("PeopleStates").GetComponent <PeopleStates>(); m_pStateMachine = new StateMachine <People>(this); m_pStateMachine.SetCurrentState(States.IdleState); }
public void happy() { currentState = PeopleStates.happy; }
public void normal() { currentState = PeopleStates.normal; }
private void Start() { currentState = PeopleStates.normal; }