Exemplo n.º 1
0
    void Start()
    {
        rigidBody     = GetComponent <Rigidbody>();
        tankAudio     = GetComponents <AudioSource>();
        mapGO         = GameObject.Find("Map");
        tankGO        = GameObject.Find("Tank");
        thisTransform = GetComponent <Transform>();
        setEnemyResp();

        enemyID = nextID;
        if (nextID < 2)
        {
            nextID++;
        }
        ammo         = 100;
        ammoReloaded = true;
        agent        = GetComponent <NavMeshAgent>();
        r            = getrandom.Next(6);
        setTarget();
        mainThrust  = 80f;
        torch       = transform.Find("Light").GetComponent <Light>();
        nightModeOn = MapScript.isNightModeOn();
        torchManage();
        gm = GameObject.Find("GameManager").GetComponent <GameManagerSc>();
    }
Exemplo n.º 2
0
 void Start()
 {
     rigidBody     = GetComponent <Rigidbody>();
     tankAudio     = GetComponents <AudioSource>();
     ammo          = 1000;
     ammoReloaded  = true;
     startPosition = new Vector3(gameObject.transform.position.x,
                                 gameObject.transform.position.y, gameObject.transform.position.z);
     shieldActivated = false;
     mainThrust      = 300f;
     shield          = transform.Find("Shield").gameObject;
     shield.SetActive(false);
     torchOn       = false;
     torch         = transform.Find("Light").GetComponent <Light>();
     torch.enabled = false;
     nightModeOn   = MapScript.isNightModeOn();
     gm            = GameObject.Find("GameManager").GetComponent <GameManagerSc>();
 }
Exemplo n.º 3
0
    private void createBase()
    {
        // GameObject gamePlatformObj = Instantiate(Resources.Load("GamePlatform"),  new Vector3(center, 0.5f, center), Quaternion.identity) as GameObject;
        // gamePlatformObj.transform.localScale = new Vector3(size, gamePlatformObj.transform.localScale.y, size*2);
        // mapElements[size - 1, center + 2] = "Tank";
        Vector3 wektor = new Vector3(center + 2f, 0, 4f);

        mapElements[0, center + 2] = "Tank";
        Instantiate(Resources.Load("Tank"), new Vector3(center + 2, 0.5f, 1), Quaternion.Euler(0f, 180f, 0f));
        createStandards();
        createSpaceForPlayer(center + 2);
        createSpaceForPlayer(center - 4);
        createSingle(1, center + 2, "Empty");
        createSingle(2, center + 2, "Empty");
        createSingle(center + 2, 1, "Empty");
        createSingle(1, center, "Stone");
        createSingle(1, center + 1, "Stone");
        createSingle(1, center - 1, "Stone");
        createSingle(2, center + 1, "Empty");
        createSingle(2, center - 1, "Empty");
        createSingle(2, center, "Empty");
        createSingle(2, center - 2, "Empty");
        createSingle(2, center + 2, "Empty");
        createSingle(0, center - 1, "Stone");
        createSingle(0, center + 1, "Stone");
        if (MapScript.isNightModeOn())
        {
            createBaseLamps();
        }
        createHeartBase();


        for (int i = 0; i < size; ++i)
        {
            for (int j = 0; j < size; ++j)
            {
                if (mapElements[i, j] == null)
                {
                    choseRandomElement(i, j);
                }
            }
        }
    }