void kaytaEsine()
    {
        Elama elamaScripti = GameObject.Find("Ukko").GetComponent <Elama>();

        if (elamaScripti.HP + hpParannus > elamaScripti.maxHP)
        {
            elamaScripti.HP = elamaScripti.maxHP;
        }
        else
        {
            elamaScripti.HP += hpParannus;
        }
        Destroy(gameObject);
    }
 void Start()
 {
     eScripti = GetComponent <Elama>();
 }
Exemple #3
0
 void Awake()
 {
     ukko      = GameObject.Find("Ukko");
     hpScripti = ukko.GetComponent <Elama>();
 }