Ejemplo n.º 1
0
    // =============================================================================================SPAWNING SET 7================================================================
    //---------------------------------------------------------------------------------------MECHANISM WORK GAP = 1.6 sec --------------------------------------------------------
    //------------------------------------------------------------------------------------NUMBER OF ROCKETS = 8-------------------------------------------------------------------

    void spawnrock7()
    {
        //SET1---------------------------------------------------------------------------------------------------------------------------------------------------------------------
        if (_time2 == 248)
        {
            Pusher1.SetActive(true);
            pusher1.instance.forcemove = true;
        }
        if (_time2 == 249)
        {
            Pusher3.SetActive(true);
            pusher2.instance.forcemove = true;
        }
        if (_time2 == 252)
        {
            Pusher1.SetActive(false);
        }
        if (_time2 == 253)
        {
            Pusher3.SetActive(false);
        }
        //SET 2-----------------------------------------------------------------------------------------------------------------------------------------------------------------
        if (_time2 >= 254 && _time2 < 260)
        {
            if (_time2 == 255 || _time2 == 258)
            {
                Instantiate(roundaboutrocket, new Vector3(transform.position.x, Random.Range(y1, y2), 0), Quaternion.identity);
            }
            else
            {
                Instantiate(rocket, new Vector3(transform.position.x, Random.Range(y1, y3), 0), Quaternion.identity);         //8
            }
        }
        //SET 3------------------------------------------------------------------------------------------------------------------------------------------------------------------
        if (_time2 == 261)
        {
            Pusher1.SetActive(true);
            pusher.instance.forcemove = true;
        }
        if (_time2 == 262)
        {
            Pusher3.SetActive(true);
            pusher2.instance.forcemove = true;
        }
        if (_time2 == 263)
        {
            Pusher2.SetActive(true);
            pusher1.instance.forcemove = true;
        }
        if (_time2 == 264)
        {
            pusher2.instance.forcemove = true;
        }
        if (_time2 == 265)
        {
            pusher.instance.forcemove = true;
            Pusher2.SetActive(false);
        }
        //SET 4----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        if (_time2 == 267)
        {
            plat.SetActive(true);
            platform.instance.move = true;
        }
        if (_time2 == 269)
        {
            pusher.instance.forcemove  = true;
            pusher2.instance.forcemove = true;
        }
        if (_time2 == 272)
        {
            platform.instance.move = false;
        }
        if (_time2 == 274)
        {
            plat.SetActive(false);
            Pusher1.SetActive(false);
            Pusher3.SetActive(false);
            CancelInvoke("spawnrock7");
            InvokeRepeating("spawnrock8", 1, 1.2f);
        }
        _time2++;
    }
Ejemplo n.º 2
0
 //===============================================================SPAWNING SET 8====================================================================================
 //----------------------------------------------------------ROCKET SPAWN TIME =1.2 sec---------------------------------------------------------------------------
 //-------------------------------------------------------NUMBER OF ROCKETS =  45------------------------------------------------------------------------------
 void spawnrock8()
 {
     if (_time2 == 275)
     {
         pole1.instance.moved   = true;
         charger.instance.moved = true;
     }
     //SET1 -------------------------------------------------------------------------------------------------------------------------------------------------------
     if (_time2 >= 276 && _time2 < 288)
     {
         Instantiate(rocket, new Vector3(transform.position.x, Random.Range(1.95f, -3.1f), 0), Quaternion.identity); //12
     }
     if (_time2 == 289)
     {
         Pusher2.SetActive(true);
         pusher1.instance.forcemove = true;
     }
     if (_time2 == 293)
     {
         Pusher2.SetActive(false);
     }
     //SET2-------------------------------------------------------------------------------------------------------------------------------------------------------------
     if (_time2 >= 294 && _time2 < 296)
     {
         Instantiate(rocket, new Vector3(transform.position.x, -3.05f, 0), Quaternion.identity);
     }
     if (_time2 >= 298 && _time2 < 301)                                                                                      //6
     {
         Instantiate(rocket, new Vector3(transform.position.x, -2.6f, 0), Quaternion.identity);
     }
     //SET 3---------------------------------------------------------------------------------------------------------------------------------------------------------------
     if (_time2 >= 302 && _time2 < 311)
     {
         Instantiate(rocket, new Vector3(transform.position.x, Random.Range(1.95f, -3.1f), 0), Quaternion.identity); //10
     }
     //SET 4---------------------------------------------------------------------------------------------------------------------------------------------------------------
     if (_time2 == 312 && _time2 == 313)
     {
         Instantiate(failyrocket, new Vector3(transform.position.x, Random.Range(3.58f, 3.56f), 0), Quaternion.identity);//2
     }
     if (_time2 == 314)
     {
         charger.instance.moved    = false;
         pole1.instance.moved      = false;
         danger.instance.activated = true;
     }
     //SET 5
     if (_time2 == 317 || _time2 == 318 || _time2 == 319)
     {
         Instantiate(rocket, new Vector3(transform.position.x, -4f), Quaternion.identity);
         Instantiate(rocket, new Vector3(transform.position.x, -2f), Quaternion.identity);
         Instantiate(rocket, new Vector3(transform.position.x, 1.91f), Quaternion.identity);     //15
         Instantiate(rocket, new Vector3(transform.position.x, 3.12f), Quaternion.identity);
         Instantiate(rocket, new Vector3(transform.position.x, 3.99f), Quaternion.identity);
     }
     if (_time2 == 318)
     {
         _time2 = 0;
         CancelInvoke("spawnrock8");
         StartCoroutine(spawn(0));
     }
     _time2++;
 }
Ejemplo n.º 3
0
    //================================================================================= SPAWNING SET 5 =============================================================================
    //----------------------------------------------------------------------------ROCKET SPAWN TIME = 1.6 sec------------------------------------------------------------------------
    //----------------------------------------------------------------------------NUMBER OF ROCKETS =   21      -------------------------------------------------------------------------
    void spawnrock5()
    {
        //SET 1------------------------------------------------------------------------------------------------------------------------------------------------------------------
        if (_time2 == 173 && stopspawning == false)
        {
            Pusher1.SetActive(true);
            pusher.instance.forcemove = true;
        }
        if (_time2 == 177 && stopspawning == false)
        {
            Pusher1.SetActive(false);
            charger.instance.moved = true;
        }
        if (_time2 >= 177 && _time2 < 183 && stopspawning == false)
        {
            Vector3 v = new Vector3(transform.position.x, Random.Range(y1, -3.1f), 0);         //5
            Instantiate(rocket, v, Quaternion.identity);
        }
        if (_time2 == 183 && stopspawning == false)
        {
            Pusher2.SetActive(true);
            pusher1.instance.forcemove = true;
        }
        if (_time2 == 187)
        {
            Pusher2.SetActive(false);
            charger.instance.moved = false;
        }
        //SET 2----------------------------------------------------------------------------------------------------------------------------------------------------------------

        if (_time2 == 188 && stopspawning == false)
        {
            Instantiate(rocket, new Vector3(transform.position.x, Random.Range(y1, y3), 0), Quaternion.identity);
            Instantiate(rocket, new Vector3(transform.position.x, Random.Range(y1, y3), 0), Quaternion.identity);
        }
        if (_time2 == 190 && stopspawning == false)
        {
            Instantiate(rocket, new Vector3(transform.position.x, Random.Range(y1, y3), 0), Quaternion.identity);
            Instantiate(rocket, new Vector3(transform.position.x, Random.Range(y1, y3), 0), Quaternion.identity);    //6
        }
        if (_time2 == 192 && stopspawning == false)
        {
            Instantiate(rocket, new Vector3(transform.position.x, Random.Range(y1, y3), 0), Quaternion.identity);
            Instantiate(rocket, new Vector3(transform.position.x, Random.Range(y1, y3), 0), Quaternion.identity);
        }
        //SET 3-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        if (_time2 >= 193 && _time2 < 196 && stopspawning == false)
        {
            Vector3 v = new Vector3(transform.position.x, Random.Range(y1, 0f), 0);                              //4
            Instantiate(failyrocket, v, Quaternion.identity);
        }
        //SET 4-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        if (_time2 == 197 && stopspawning == false)
        {
            Instantiate(rocket, new Vector3(transform.position.x, -4.17f, 0), Quaternion.identity);
        }
        if (_time2 == 198 && stopspawning == false)
        {
            Instantiate(rocket, new Vector3(transform.position.x, -2.8f, 0), Quaternion.identity);
            Instantiate(rocket, new Vector3(transform.position.x, -4.1f, 0), Quaternion.identity);            //6
        }
        if (_time2 == 200 && stopspawning == false)
        {
            Instantiate(rocket, new Vector3(transform.position.x, -1f, 0), Quaternion.identity);
            Instantiate(rocket, new Vector3(transform.position.x, -2.8f, 0), Quaternion.identity);
            Instantiate(rocket, new Vector3(transform.position.x, -4.1f, 0), Quaternion.identity);
        }
        if (_time2 == 201 && stopspawning == false)
        {
            CancelInvoke("spawnrock5");
            InvokeRepeating("spawnrock6", 1, 1.22f);
        }
        _time2++;
        //exit time =200
    }