// Use this for initialization void Start() { health = GetComponent <AI_health>(); isDead = health.Death(); agent = GetComponent <NavMeshAgent>(); anim = GetComponent <Animator>(); if (des.Length == 0) { des = GameObject.FindGameObjectsWithTag("spawnpoints"); } index = Random.Range(0, des.Length); agent.destination = des[index].transform.position; if (agent.remainingDistance <= agent.stoppingDistance) { isRunning = false; } else { isRunning = true; } anim.SetBool("isWalking", isRunning); }
// Use this for initialization void Start() { health = GetComponent <AI_health>(); pooler = ObjectPooler.Instance; isDead = health.dead; tag_number = 0; if (spawn_points.Length == 0) { spawn_points = GameObject.FindGameObjectsWithTag("spawnpoints"); } }
private void Awake() { Instance = this; }