public void Choose() { add = GameObject.FindWithTag("button").GetComponent <KidsScript>(); add1 = GameObject.FindWithTag("button1").GetComponent <KidsScript>(); if (add.qntAtual >= add.qntNec) { add = GameObject.FindWithTag("button1").GetComponent <KidsScript>(); add1 = GameObject.FindWithTag("button2").GetComponent <KidsScript>(); } if (add1.qntAtual < add1.qntNec && add.qntAtual >= add.qntNec) { add = GameObject.FindWithTag("button2").GetComponent <KidsScript>(); } }
// Use this for initialization void Start() { kidThree = GameObject.FindWithTag("button2").GetComponent <KidsScript>(); }