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>();
 }
示例#2
0
 // 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);
 }
示例#3
0
 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)
 {
 }
示例#5
0
 public UseSmartObject(T stateName, StateDrivenBrain controller, float minDuration) : base(stateName, controller, minDuration)
 {
 }
示例#6
0
 public Animate(T stateName, StateDrivenBrain controller, float minDuration) : base(stateName, controller, minDuration)
 {
 }
示例#7
0
 // Sets up FSM
 public AIState(T stateName, StateDrivenBrain brain, float minDuration) : base(stateName, brain, minDuration)
 {
     this.brain = brain;
 }
示例#8
0
 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;
 }
示例#10
0
 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>();
 }
示例#11
0
 public Action(string name, int cost, StateDrivenBrain brain, StateDrivenBrain.TacticalStates moveToState) : base(name, cost, moveToState)
 {
     this.brain  = brain;
     angleOffset = 0f;
 }
示例#12
0
 public buildHouse(string name, int cost, StateDrivenBrain brain, StateDrivenBrain.TacticalStates moveToState) : base(name, cost, brain, moveToState)
 {
 }
示例#13
0
    // --------------------------------------------------------------

    void Awake()
    {
        m_CharacterController = GetComponent <CharacterController>();
        audioSource           = GetComponent <AudioSource>();
        brain = this.GetComponent <StateDrivenBrain>();
    }