Пример #1
0
        public void Show(ChangeSceneType changeType = ChangeSceneType.Open, Action onEnd = null)
        {
            if (go == null)
            {
                go = ResourcesMrg.Instance.Load(ResourcesMrg.ResourceType.UIWindow, "panChangeScene", true);
            }
            if (go == null)
            {
                return;
            }
            go.SetActive(true);
            Transform parent = UISceneCtrl.Instance.CurrentUIScene.ContainerCenter;

            go.transform.SetParent(parent);
            go.transform.localPosition = Vector3.zero;
            go.transform.localScale    = Vector3.one;
            go.GetComponent <RectTransform>().sizeDelta = Vector2.zero;

            UIChangeSceneView window = go.GetComponent <UIChangeSceneView>();

            window.Show(changeType, () =>
            {
                if (onEnd != null)
                {
                    onEnd();
                }
                if (changeType == ChangeSceneType.Open || changeType == ChangeSceneType.CloseAndOpen)
                {
                    go.SetActive(false);
                }
            });
        }
        public void Show(ChangeSceneType changeType, float time = 1, Action onEnd = null)
        {
            if (go == null)
            {
                go = ResourcesMrg.Instance.Load(ResourcesMrg.ResourceType.UIWindow, "panChangeScene", true);
            }
            if (go == null)
            {
                return;
            }
            UIChangeSceneView window = go.GetComponent <UIChangeSceneView>();

            window.SetEnable(true);
            Transform parent = UISceneCtrl.Instance.CurrentUIScene.ContainerCenter;

            go.transform.SetParent(parent);
            go.transform.localPosition = Vector3.zero;
            go.transform.localScale    = Vector3.one;
            go.GetComponent <RectTransform>().sizeDelta = Vector2.zero;
            window.Show(changeType, time, () => { if (onEnd != null)
                                                  {
                                                      onEnd();
                                                  }
                                                  ; window.SetEnable(false);; });
            //EditorApplication.isPaused = true;
        }