void Awake() { perceptionManager = GameObject.FindGameObjectWithTag(Tags.GameController).GetComponent <PerceptionManager>(); agentFilter = HOSTILE; envelopes = new List <Envelope>(); response = TResponses.DoNothing; target = null; brain = this.gameObject.GetComponent <StateDrivenBrain>(); }
// 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) { thisObject = animator.gameObject; brain = thisObject.GetComponent <StateDrivenBrain>(); audioSource = thisObject.GetComponent <AudioSource>(); if (thisObject.GetComponent <AIController>() != null) { die = thisObject.GetComponent <AIController>().m_Die; } audioSource.volume = 0.5f; audioSource.PlayOneShot(die); }
public GoToTent(string name, int cost, StateDrivenBrain brain, StateDrivenBrain.TacticalStates moveToState) : base(name, cost, brain, moveToState) { }
public PickupNails(string name, int cost, StateDrivenBrain brain, StateDrivenBrain.TacticalStates moveToState) : base(name, cost, brain, moveToState) { }
public UseSmartObject(T stateName, StateDrivenBrain controller, float minDuration) : base(stateName, controller, minDuration) { }
public Animate(T stateName, StateDrivenBrain controller, float minDuration) : base(stateName, controller, minDuration) { }
// Sets up FSM public AIState(T stateName, StateDrivenBrain brain, float minDuration) : base(stateName, brain, minDuration) { this.brain = brain; }
public FindPlayer(T stateName, StateDrivenBrain controller, float minDuration) : base(stateName, controller, minDuration) { }
public AttackWithGun(string name, int cost, StateDrivenBrain brain, StateDrivenBrain.TacticalStates moveToState) : base(name, cost, brain, moveToState) { angleOffset = -20f; }
public getInRangeOfPlayer(string name, int cost, StateDrivenBrain brain, StateDrivenBrain.TacticalStates moveToState) : base(name, cost, brain, moveToState) { angleOffset = -20f; perceptionManager = GameObject.FindGameObjectWithTag(Tags.GameController).GetComponent <PerceptionManager>(); }
public Action(string name, int cost, StateDrivenBrain brain, StateDrivenBrain.TacticalStates moveToState) : base(name, cost, moveToState) { this.brain = brain; angleOffset = 0f; }
public buildHouse(string name, int cost, StateDrivenBrain brain, StateDrivenBrain.TacticalStates moveToState) : base(name, cost, brain, moveToState) { }
// -------------------------------------------------------------- void Awake() { m_CharacterController = GetComponent <CharacterController>(); audioSource = GetComponent <AudioSource>(); brain = this.GetComponent <StateDrivenBrain>(); }