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>(); }
void Awake() { ukko = GameObject.Find("Ukko"); hpScripti = ukko.GetComponent <Elama>(); }