void Start() { soplya = GameObject.Find("Soplya"); SnoozeControl snoozeScript = soplya.GetComponent <SnoozeControl> (); LiqiudBehaviour LiquidScript = Liquid.GetComponent <LiqiudBehaviour> (); setScript(snoozeScript); }
void OnTriggerEnter2D(Collider2D col) { if (col.gameObject.name == "HitBox") { SnoozeControl script = getScript(); script.ChangeScore(1); //script.PrintScore (); Destroy(gameObject); } }
void setScript(SnoozeControl script) { snoozeScr = script; }