Exemplo n.º 1
0
    // 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);
    }
Exemplo n.º 2
0
    // 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");
        }
    }
Exemplo n.º 3
0
 private void Awake()
 {
     Instance = this;
 }