protected BaseState(AIAgent aiAgent) { this.aiAgent = aiAgent; aiCoverFinder = aiAgent.coverFinder; aiShooting = aiAgent.aiShooting; navInterface = aiAgent.navInterface; layerMask = aiAgent.layerMask; transform = aiAgent.transform; }
private void Awake() { aiShooting = GetComponent <AIShooting>(); coverFinder = GetComponent <AICoverFinder>(); mTransform = transform; navInterface = gameObject.AddComponent <NavmeshInterface>(); navInterface.Init(gameObject, agentStats); }
void Awake() { m_AIMovement = GetComponent <AIMovement> (); m_NavMeshAgent = GetComponent <NavMeshAgent> (); m_AIAnimations = GetComponent <AIAnimations> (); m_AIHealth = GetComponent <AIHealth> (); m_Animator = GetComponent <Animator> (); m_AIBehaviours = GetComponent <AIBehaviours> (); m_Class = GetComponent <Class> (); m_AIShooting = GetComponent <AIShooting> (); }
// Use this for initialization void Start() { anim = GetComponent <Animator> (); nav = GetComponent <NavMeshAgent> (); health = GetComponent <Health> (); ais = GetComponent <AIShooting> (); anim.SetBool("IsWalking", true); waiting = false; reached = false; rand = Random.Range(0, positions.Length); if (team == 1) { enemies = GameObject.FindGameObjectsWithTag("Team 2"); } else { enemies = GameObject.FindGameObjectsWithTag("Team 1"); } }