public override void OnSelectionChange()
        {
            isNoticeIgnore = false;
            if (!FR2_Cache.isReady)
            {
                return;
            }

            if (lockSelection)
            {
                return;
            }

            if (focusedWindow == null)
            {
                return;
            }

            if (SceneUsesDrawer == null)
            {
                InitIfNeeded();
            }

            ids = FR2_Unity.Selection_AssetGUIDs;

            //ignore selection on asset when selected any object in scene
            if (Selection.gameObjects.Length > 0 && !FR2_Unity.IsInAsset(Selection.gameObjects[0]))
            {
                ids = new string[0];
            }

            if (IsFocusingSceneInScene)
            {
                RefSceneInScene.ResetSceneInScene(Selection.gameObjects);
            }

            if (IsFocusingUses)
            {
                SceneUsesDrawer.ResetSceneUseSceneObjects(Selection.gameObjects);
            }

            if (IsFocusingFindInScene)
            {
                RefInScene.Reset(ids, this as IWindow);
            }

            level = 0;

            EditorApplication.delayCall += Repaint;
        }
Exemple #2
0
        public override void OnSelectionChange()
        {
            Repaint();

            isNoticeIgnore = false;
            if (!FR2_Cache.isReady)
            {
                return;
            }

            if (lockSelection)
            {
                return;
            }

            if (focusedWindow == null)
            {
                return;
            }

            if (SceneUsesDrawer == null)
            {
                InitIfNeeded();
            }

            if (UsesDrawer == null)
            {
                InitIfNeeded();
            }

            ids = FR2_Unity.Selection_AssetGUIDs;

            //ignore selection on asset when selected any object in scene
            if (Selection.gameObjects.Length > 0 && !FR2_Unity.IsInAsset(Selection.gameObjects[0]))
            {
                ids = new string[0];
            }

            level = 0;
            if (IsFocusingSceneToAsset)
            {
                SceneToAssetDrawer.Reset(Selection.gameObjects, true, true);
            }

            if (IsFocusingUses)
            {
                UsesDrawer.Reset(ids, true);
            }

            if (IsFocusingUsedBy)
            {
                UsedByDrawer.Reset(ids, false);
            }

            if (IsFocusingSceneInScene)
            {
                RefSceneInScene.ResetSceneInScene(Selection.gameObjects);
            }

            if (IsFocusingUses)
            {
                SceneUsesDrawer.ResetSceneUseSceneObjects(Selection.gameObjects);
            }

            if (IsFocusingFindInScene)
            {
                RefInScene.Reset(ids, this as IWindow);
            }

            if (IsFocusingGUIDs)
            {
                objs = new Object[ids.Length];
                for (var i = 0; i < ids.Length; i++)
                {
                    objs[i] = FR2_Unity.LoadAssetAtPath <Object>
                              (
                        AssetDatabase.GUIDToAssetPath(ids[i])
                              );
                }
            }


            if (FR2_SceneCache.Api.Dirty && !Application.isPlaying)
            {
                FR2_SceneCache.Api.refreshCache(this);
            }

            EditorApplication.delayCall -= Repaint;
            EditorApplication.delayCall += Repaint;
        }