// ================================================================ // void Awake() { // 垫在下面 this.underlay = GameObject.Instantiate(this.underlay_prefab).GetComponent <UIUnderlay>(); this.underlay.GetComponent <RectTransform>().SetParent(this.GetComponent <RectTransform>()); this.underlay.GetComponent <RectTransform>().SetSiblingIndex(0); this.gameObject.SetActive(false); }
// ================================================================ // void Awake() { this.ui_text = this.GetComponentInChildren <UnityEngine.UI.Text>(); this.ui_button = this.GetComponent <UnityEngine.UI.Button>(); // 下じき. this.underlay = GameObject.Instantiate(this.underlay_prefab).GetComponent <UIUnderlay>(); this.underlay.GetComponent <RectTransform>().SetParent(this.GetComponent <RectTransform>()); this.underlay.GetComponent <RectTransform>().SetSiblingIndex(0); }