Example #1
0
            public void AddGameObjectIfMatching(Transform transform, object userData)
            {
                UInt64 fileID = Unsupported.GetOrGenerateFileIDHint(transform.gameObject);

                if (m_FileIDs.Contains(fileID))
                {
                    instanceIDs.Add(transform.gameObject.GetInstanceID());
                }
                if (fileID == m_FileID)
                {
                    instanceID = transform.gameObject.GetInstanceID();
                }
            }
Example #2
0
        static List <UInt64> GetExpandedGameObjectFileIDs(SceneHierarchyWindow hierarchy)
        {
            var fileIDs             = new List <UInt64>();
            var expandedGameObjects = hierarchy.sceneHierarchy.GetExpandedGameObjects();

            foreach (var go in expandedGameObjects)
            {
                UInt64 fileID = Unsupported.GetOrGenerateFileIDHint(go);
                if (fileID != 0)
                {
                    fileIDs.Add(fileID);
                }
            }
            return(fileIDs);
        }
Example #3
0
        public void SaveStateFromHierarchy(SceneHierarchyWindow hierarchy, Stage stage)
        {
            var lastClickedGameObject = EditorUtility.InstanceIDToObject(hierarchy.sceneHierarchy.treeViewState.lastClickedID) as GameObject;

            m_LastClickedFileID = lastClickedGameObject != null?Unsupported.GetOrGenerateFileIDHint(lastClickedGameObject) : 0;

            m_ExpandedPrefabGameObjectFileIDs = GetExpandedGameObjectFileIDs(hierarchy);

            m_ScrollY = hierarchy.sceneHierarchy.treeViewState.scrollPos.y;

            if (SceneHierarchy.s_DebugPersistingExpandedState)
            {
                DebugLog("Saving", stage);
            }
        }