Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="bytes"></param>
        public void OnMessageEvent(BinaryReader binaryReader)
        {
            gameObjectKuns.Clear();
            sceneKun.Deserialize(binaryReader);

            for (var i = 0; i < sceneKun.gameObjectKuns.Length; i++)
            {
                gameObjectKuns.Add(sceneKun.gameObjectKuns[i].instanceID, sceneKun.gameObjectKuns[i]);
            }


#if UNITY_2019_1_OR_NEWER
            if (!EditorWindow.HasOpenInstances <PlayerHierarchyWindow>())
#else
            if (!HasOpenInstances <PlayerHierarchyWindow>())
#endif
            {
                PlayerHierarchyWindow.Create();
            }
            var window = (PlayerHierarchyWindow)EditorWindow.GetWindow(typeof(PlayerHierarchyWindow));
            if (window != null)
            {
                window.selectionChangedCB = SelectionChangedCB;
                window.sceneKun           = sceneKun;
                window.Reload();
            }
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="selectedIds"></param>
        void SelectionChangedCB(IList <int> selectedIds)
        {
#if UNITY_2019_1_OR_NEWER
            if (!EditorWindow.HasOpenInstances <PlayerHierarchyWindow>())
#else
            if (!HasOpenInstances <PlayerHierarchyWindow>())
#endif
            {
                PlayerHierarchyWindow.Create();
            }
            var window = (PlayerHierarchyWindow)EditorWindow.GetWindow(typeof(PlayerHierarchyWindow));
            var id     = window.lastClickedID;
            if (gameObjectKuns.ContainsKey(id))
            {
                var gameObjectKun = gameObjectKuns[id];
                settings.Set(gameObjectKun);
                BuildComponentView(gameObjectKun);
            }
            else
            {
                settings.Set(null);
                BuildComponentView(null);
            }

            var choseKunEditorWindow = (UnityChoseKunEditorWindow)EditorWindow.GetWindow(typeof(UnityChoseKunEditorWindow));
            if (choseKunEditorWindow != null)
            {
                choseKunEditorWindow.Repaint();
            }
        }
Example #3
0
        public InspectorView()
        {
#if UNITY_2019_1_OR_NEWER
            if (!EditorWindow.HasOpenInstances <PlayerHierarchyWindow>())
#else
            if (!HasOpenInstances <PlayerHierarchyWindow>())
#endif
            {
                PlayerHierarchyWindow.Create();
            }
            var window = (PlayerHierarchyWindow)EditorWindow.GetWindow(typeof(PlayerHierarchyWindow));
            if (window != null)
            {
                window.selectionChangedCB = SelectionChangedCB;
            }
            m_selectGameObujectKunID = -1;
        }