//**************************************************************************************************** // //**************************************************************************************************** public void OnDestroy() { if (m_instance == this) { m_instance = null; } }
//**************************************************************************************************** // //**************************************************************************************************** public void Awake() { if (m_instance == null) { m_instance = this; } m_group = GetComponent <CanvasGroup>(); GameObject root = gameObject; GameObject content = CORE.HIERARCHY.Find(root, "Content"); GameObject buts = CORE.HIERARCHY.Find(root, "Buttons"); m_coordsSys = CORE.HIERARCHY.FindComp <UnityEngine.UI.Dropdown>(content, "COORDS_SYS"); m_RESET = new CORE.UIButton(CORE.HIERARCHY.FindComp <UnityEngine.UI.Button>(buts, "RESET")); m_CANCEL = new CORE.UIButton(CORE.HIERARCHY.FindComp <UnityEngine.UI.Button>(buts, "CANCEL")); m_OK = new CORE.UIButton(CORE.HIERARCHY.FindComp <UnityEngine.UI.Button>(buts, "OK")); if (m_coordsSys != null) { m_coordsSys.onValueChanged.RemoveAllListeners(); m_coordsSys.onValueChanged.AddListener(delegate { OnValueChanged(m_coordsSys); }); } for (int col = 0; col < ( int )CSV.COL.NB; ++col) { int dropDown = col; m_dropDowns[col] = CORE.HIERARCHY.FindComp <UnityEngine.UI.Dropdown>(content, ((CSV.COL)col).ToString()); if (m_dropDowns[col] != null) { m_dropDowns[col].onValueChanged.RemoveAllListeners(); m_dropDowns[col].onValueChanged.AddListener(delegate { OnValueChanged(dropDown); }); } } m_RESET.SetListener(delegate { OnRESET(); }); m_CANCEL.SetListener(delegate { OnCANCEL(); }); m_OK.SetListener(delegate { OnOK(); }); m_fade.Begin(FADE_TYPE.FADE_OUT, 0.0f); gameObject.SetActive(false); }
//************************************************************************************************ // //************************************************************************************************ private void OnPopupCSVConfigButton(POPUPCsvConfig popup, POPUPCsvConfig.BUTON but) { if (but == POPUPCsvConfig.BUTON.OK) { m_options = popup.m_options.byval; Import(); } }