Пример #1
0
 public void decreaseLives()
 {
     lives -= 1;
     updateLives();
     if (lives == 0)
     {
         GameObject parent = UICamera.first.transform.parent.gameObject;
         GameObject obj    = NGUITools.AddChild(parent, loosePrefab);
         LoosePopup popup  = obj.GetComponent <LoosePopup>();
     }
 }
Пример #2
0
    public void onRabitDeath(GameObject rabit)
    {
        if (LivesController.current != null)
        {
            LivesController.current.onRabitDeath();
        }

        if (SceneManager.GetActiveScene().name == "LevelSelect" || LivesController.current.livesLeft > 0)
        {
            //При смерті кролика повертаємо на початкову позицію
            rabit.transform.position = this.startingPosition;
        }
        else
        {
            coins = 0;
            //Знайти батьківський елемент
            GameObject parent = UICamera.first.transform.parent.gameObject;
            //Створити Prefab
            GameObject obj        = NGUITools.AddChild(parent, loosePopupPrefab);
            LoosePopup loosePopup = obj.GetComponent <LoosePopup> ();
        }
    }