Example #1
0
    // Use this for initialization
    void Start()
    {
        print(id+" creating alien");

        health=healthMax;

        healthBar = (HealthBar)Instantiate(	healthBarPrefab,
                            new Vector3(transform.position.x, transform.position.y+1.5f, transform.position.z),
                            Quaternion.identity
              		);
        healthBar.setAlien(this);

        xtarget=x; ytarget=y;
        map = new terrain[100,100];
        from = new Vector3[100,100];
        for(int i=0; i<100; i++)
            for(int j=0; j<100; j++)
                if(i<tg.sizeOfMap && j<tg.sizeOfMap)
                    map[i,j]=terrain.unknown;
                else
                    map[i,j]=terrain.outofmap;

        agent = GetComponent<NavMeshAgent>();
    }