public void Initialize(Transform saveParent) { OpenEvent = gameObject.AddComponent <UiOpenEvent>(); SaveParent = saveParent; transform.parent = saveParent; transform.localPosition = StartPos; transform.localScale = Vector3.one; for (int i = 0; i < DownValues.Length; i++) { UpValues[i].gameObject.GetComponent <TweenAlpha>().delay = AcDelay + AcDuration; DownValues[i].gameObject.GetComponent <TweenAlpha>().delay = AcDelay + AcDuration; UpValues[i].gameObject.SetActive(false); DownValues[i].gameObject.SetActive(false); } for (int i = 0; i < MenuType.Length; i++) { MenuType[i].text = "0"; } SetPowerTime(SceneManager.instance.RegenPowerTime); ///뒤로가기 버튼 눌렀을때 현재 페널에 알려준다. EventDelegate.Set(BackButton.onClick, delegate() { UIMgr.instance.Prev(); }); EventDelegate.Set(CategoryGo.GetComponent <UIEventTrigger>().onClick, () => { UIBasePanel cago = UIMgr.GetUIBasePanel("UIPanel/CategoryPanel"); if (cago != null && cago.gameObject.activeSelf) { return; } if (CurPanel != null) { CurPanel.ObjectHide(); } UIMgr.OpenCategoryPanel(CurPanel); }); gameObject.SetActive(false); }
void Awake() { uiMgr = UIMgr.instance; if (Managed) { uiMgr.AddUI(this); } Init(); if (UiEventType != eUIEventType.Not && _UiOpenEvent == null) { _UiOpenEvent = GetComponent <UiOpenEvent>(); if (_UiOpenEvent == null) { _UiOpenEvent = gameObject.AddComponent <UiOpenEvent>(); } } }