コード例 #1
0
        private void CreateWindow()
        {
            if (isOpen)
            {
                Close();
            }

            window         = ScriptableObject.CreateInstance <WrappedEditorWindow>();
            window.wrapper = this;
            ConfigureWindow();
            OnShow(); // HACK: Can't use WrappedEditorWindow.Awake/OnEnable, because it's called before we set the wrapper.
        }
コード例 #2
0
        public void Close()
        {
            try
            {
                window?.Close();
            }
            catch (NullReferenceException)
            {
                // EditorWindow.Close throws an NRE when it's
                // closed before the first frame it was opened.
            }

            window = null;
        }