public void returnToMainMenu() { InterfaceMainButtons.REF.onCloseOtherScreen(); if(otherCars!=null) { Destroy(otherCars.gameObject); Destroy(otherCars); otherCars = null; } Destroy(this.gameObject); }
public void showOtherCars() { if(otherCars!=null) { Destroy(otherCars.gameObject); } GameObject go = NGUITools.AddChild(this.gameObject.transform.parent.gameObject,prefabBuyCars.gameObject); Debug.Log (go.name); otherCars = go.GetComponent<BuyCarsScreen>(); if(otherCars!=null) otherCars.init(this,this.carRef); hideButtons(); }