Exemplo n.º 1
0
        private static void Init()
        {
            if (initilized)
            {
                return;
            }

            if (PlayerPrefs.HasKey(strKey))
            {
                dontShowWeclomeMessageAgain = CommonUtil.ZeroOneToTrueFalseBool(PlayerPrefs.GetInt(strKey));
            }

            if (dontShowWeclomeMessageAgain)
            {
                return;
            }

            window = (WelcomePopup)EditorWindow.GetWindow(typeof(WelcomePopup));
            window.titleContent.text = "Welcome";
            window.maxSize           = size;
            window.maximized         = true;
            window.position          = new Rect((Screen.currentResolution.width - size.x) / 2, (Screen.currentResolution.height - size.y) / 2, size.x, size.y);
            window.Show();
            window.Focus();

            initilized = true;

            PlayerPrefs.SetInt(strKey, CommonUtil.TrueFalseBoolToZeroOne(true));
        }
Exemplo n.º 2
0
        static void Update()
        {
            if (Application.isPlaying)
            {
                if (window != null)
                {
                    window.Close();
                    window = null;
                }
                return;
            }

            if (window == null)
            {
                Init();
            }
        }