// 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) { animator.SetBool("OrderTaken", false); npc = animator.GetComponent <NpcAi>(); npc.cloud.SetActive(false); npc.orderSprites = false; npc.state = "OrderTaken"; npc.orderSystem.GetComponent <OrderManager>().UpdateOrders(npc.order); }
// 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) { animator.SetBool("Ordering", false); npc = animator.GetComponent <NpcAi>(); if (!npc.orderSprites) { npc.initiateOrderSprites(); } npc.state = "Ordering"; }
void Awake() { col = GetComponent<SphereCollider> (); col.radius = GetComponent<NpcAi> ().detectRange; col.isTrigger = true; nav = GetComponent<NavMeshAgent> (); anim = GetComponentInChildren<Animator> (); ai = GetComponent<NpcAi> (); senseTarget = null; InvokeRepeating ("GroundedCheck", 0.1f, 0.1f); }
void Awake() { col = GetComponent <SphereCollider> (); col.radius = GetComponent <NpcAi> ().detectRange; col.isTrigger = true; nav = GetComponent <NavMeshAgent> (); anim = GetComponentInChildren <Animator> (); ai = GetComponent <NpcAi> (); senseTarget = null; InvokeRepeating("GroundedCheck", 0.1f, 0.1f); }
internal ServerContext(Listener listener, DataManager data, Coroutine coroutine) { _listener = listener; _data = data; _coroutine = coroutine; _npcAi = new NpcAi(this); LoadObjectsFromStore(); if (_gameObjects.Count > 0) { _objectId = _gameObjects.Values.Select(e => e.ObjectId).Max() + 1; } }
public void OnEnter( NpcAi ai ) { //Debug.Log( "Entering state " + this.ToString() ); if( Ai == null ) { Ai = ai; } DoEnter(); _Update = true; }