比如修改一个面板的alpha。下面方法1不起作用,方法2才是正确的。
1.
this.gameObject.SetActive(false);
UIPanel m_Panel = this.GetComponent();
m_Panel.alpha = 1;
this.gameObject.SetActive(true);
2.
this.gameObject.SetActive(false);
UIPanel m_Panel = this.GetComponent();
this.gameObject.SetActive(true);
m_Panel.alpha = 1;