//
 private void OnDestroy()
 {
     if (playerViewTexture == null)
     {
         DestroyImmediate(playerViewTexture);
     }
     window = null;
 }
Esempio n. 2
0
 //
 private void OnDestroy()
 {
     UnityEditor.Networking.PlayerConnection.EditorConnection.instance.Unregister(PlayerView.kMsgSendPlayerToEditor, OnMessageEvent);
     UnityEditor.Networking.PlayerConnection.EditorConnection.instance.Unregister(PlayerView.kMsgSendPlayerToEditorHeader, OnMessageEventHeader);
     UnityEditor.Networking.PlayerConnection.EditorConnection.instance.DisconnectAll();
     if (playerViewTexture == null)
     {
         DestroyImmediate(playerViewTexture);
     }
     window = null;
 }
        static void Create()
        {
            if (window == null)
            {
                window = (PlayerViewKunEditorWindow)EditorWindow.GetWindow(typeof(PlayerViewKunEditorWindow));
            }

            window.titleContent             = new GUIContent(new GUIContent("Player View", Style.GAME_VIEW_ICON));
            window.wantsMouseMove           = true;
            window.autoRepaintOnSceneChange = true;
            window.Show();
        }
Esempio n. 4
0
        //
        private void OnEnable()
        {
            if (window == null)
            {
                window = (PlayerViewKunEditorWindow)EditorWindow.GetWindow(typeof(PlayerViewKunEditorWindow));
            }
            if (attachProfilerState == null)
            {
#if UNITY_2020_1_OR_NEWER
                attachProfilerState = PlayerConnectionUtility.GetConnectionState(this);
#else
                attachProfilerState = PlayerConnectionUtility.GetAttachToPlayerState(this);
#endif
            }
        }
        //
        private void OnEnable()
        {
            if (window == null)
            {
                window = (PlayerViewKunEditorWindow)EditorWindow.GetWindow(typeof(PlayerViewKunEditorWindow));
            }
            if (attachProfilerState == null)
            {
#if UNITY_2020_1_OR_NEWER
                attachProfilerState = PlayerConnectionUtility.GetConnectionState(this);
#else
                attachProfilerState = PlayerConnectionUtility.GetAttachToPlayerState(this);
#endif
            }
            UnityEditor.Networking.PlayerConnection.EditorConnection.instance.Initialize();
            UnityEditor.Networking.PlayerConnection.EditorConnection.instance.Register(PlayerView.kMsgSendPlayerToEditor, OnMessageEvent);
            UnityEditor.Networking.PlayerConnection.EditorConnection.instance.Register(PlayerView.kMsgSendPlayerToEditorHeader, OnMessageEventHeader);
            UnityEditor.Networking.PlayerConnection.EditorConnection.instance.RegisterConnection(OnConnection);
        }