Example #1
0
 void IncreaseHealth()
 {
     Debug.Log("won");
     fightInProgress = false;
     WoodController.AttackWithWood(); // do zmiany Łukaszku
                                      //health++;
                                      // actually why would you get hp for won battle?
 }
Example #2
0
    // Start is called before the first frame update

    private void Awake()                         //как только компонент загрузится
    {
        if (WoodController.instanceTree != null) //если этот объект уже есть, то не надо создавать новый
        {
            Destroy(this);                       //gameObject того объекта, который случайно создался
            return;
        }
        WoodController.instanceTree = this;
        //DontDestroyOnLoad(this); //чтобы при переходе с одной сцены на другую
    }
Example #3
0
 void DecreaseHealth()
 {
     Debug.Log("lost");
     fightInProgress = false;
     health--;
     WoodController.Pac(); // do zmiany Łukaszku
     if (health <= 0)
     {
         fightInProgress = false;
         LostTheWholeBattle();
     }
 }
Example #4
0
 private void OnDestroy()
 {
     WoodController.instanceTree = null; //при удалении
 }