void Awake() { Instance = this; if(specifiedUICanvasRectTransform == null) throw new System.ArgumentNullException("UI Canvas is unspecified", "specifiedUiCanvas"); uiCanvasRectTransform = specifiedUICanvasRectTransform; }
private void Awake() { UIStateController.RegisterPanel(gameObject.name, this); RectTransform thisRectTransform = GetComponent <RectTransform>(); if (thisRectTransform == null) { throw new System.Exception("No RectTransform is found on this GameObject: " + gameObject.name); } rectTransform = thisRectTransform; }
private void OnDestroy() { UIStateController.UnregisterPanel(gameObject.name); }