Exemplo n.º 1
0
 void Update()
 {
     if (Asteroid_action.isPlayer)//if player is die button activating
     {
         float time = Time.time;
         Text.SetActive(false);
         MovingZone.SetActive(false);
         Respawn_Button.SetActive(true);
         Asteroid_action.isPlayer = false;
         isgamerunning            = false;
         Invoke("showad", 0.5f);
         WalletADobj.SetActive(true);
     }
     timefromrespawn += Time.deltaTime;
     if (timefromrespawn >= 3 && isrespawning)// player can shoot when 3 seconds had not passed
     {
         while (clone == null)
         {
             clone = GameObject.FindGameObjectWithTag("Player");
         }
         Laser_spawner other = clone.GetComponent <Laser_spawner>();
         other.enabled = true;
         isrespawning  = false;
     }
 }
Exemplo n.º 2
0
    void restart()
    {
        Asteroid_Sp.speed = 0;                                          // change speed to Initial value
        clone             = Instantiate(Player, respwnpoint.transform); // spawn player
        Laser_spawner other = clone.GetComponent <Laser_spawner>();     //player can`t shoot for 3 seconds

        other.enabled = false;                                          //player can`t shoot for 3 seconds
        isgamerunning = true;
    }