Пример #1
0
        private void OpenAlertWindow(object confirmEvent, object type, object contentText, object titleText)
        {
            if (alertUI == null)
            {
                //show Alert UI ,post MessageType: OpenAlertWindow
                GameResourceLoadManager.GetInstance().LoadAssetAsync <GameObject>("AlertUI", delegate(GameObject go)
                {
                    GameObject obj = Instantiate(go) as GameObject;
                    alertUI        = obj.AddComponent <AlertView>();
                    ChangeUIViewDepthBySetParent(alertUI.gameObject.transform, UIMenuDepth.Alert);

                    obj.transform.localPosition = Vector3.zero;
                    obj.transform.localScale    = Vector3.one;

                    RectTransform rectTrans = obj.GetComponent <RectTransform>();
                    rectTrans.sizeDelta     = Vector2.zero;

                    alertUI.Open(confirmEvent, type, contentText, titleText);
                });
            }
            else
            {
                alertUI.gameObject.SetActive(true);
                alertUI.Open(confirmEvent, type, contentText, titleText);
            }
        }
Пример #2
0
        public AlertController(AlertView v)
        {
            view = v;

            //MessageDispatcher.AddObserver( OpenAlertWindow, Constants.MessageType.OpenAlertWindow );
        }