// Use this for initialization void Start() { hands.AddRange(GetComponentsInChildren <AI_Hit_Target>()); p_control = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Controller>(); anim = GetComponent <AI_Animation_Controller>(); rb = GetComponent <Rigidbody>(); }
// Use this for initialization void Start() { if (GetComponent <NavMeshAgent>() != null) { nav = GetComponent <NavMeshAgent>(); } else { Debug.LogError("You need to add a nav mesh agent"); } playerTarget = GameObject.FindGameObjectWithTag("Player"); if (GetComponent <SphereCollider>() != null) { GetComponent <SphereCollider>().radius = backoffDist / 2; } else { Debug.LogError("You need to add sphere collider"); } if (spawnPoint == null) { Debug.LogError("You need to add a spawnpoint"); } anim = GetComponent <AI_Animation_Controller>(); transform.position = determineRespawnPos(spawnPoint.position, 15); }
private bool ableToSpawn = false; // True if respawnTimer == 0 (except by default as AI already loaded) // Use this for initialization void Start() { if (GetComponent <AI_Animation_Controller>() != null) { animController = GetComponent <AI_Animation_Controller>(); } else { Debug.LogError("You need to add an animation controller to this AI"); } if (GetComponent <AI_Movement>() != null) { movement = GetComponent <AI_Movement>(); } else { Debug.LogError("You need to add an AI_Movement script to this AI"); } player = GameObject.FindGameObjectWithTag("Player"); state = aiState.ALIVE; }
// Use this for initialization void Start() { anim = GetComponentInParent <AI_Animation_Controller>(); }