Exemplo n.º 1
0
        private IsolateInfo addRunningIsolate(int i_id)
        {
            removeRunningIsolate(i_id);
            runningIsolates[i_id] = new IsolateInfo();

            return(runningIsolates[i_id]);
        }
Exemplo n.º 2
0
 private static void PlaymodeStateChanged()
 {
     if (EditorApplication.isPlayingOrWillChangePlaymode)
     {
         IsolateInfo.Show();
     }
     else
     {
         IsolateInfo.Hide();
     }
 }
Exemplo n.º 3
0
 private static void PlaymodeStateChanged(PlayModeStateChange change)
 {
     if (change == PlayModeStateChange.EnteredPlayMode)
     {
         IsolateInfo.Show();
     }
     else
     {
         IsolateInfo.Hide();
     }
 }
Exemplo n.º 4
0
        private static void EndIsolation()
        {
            if (!IsolateInfo.Instance)
            {
                return;
            }

            if (IsolateInfo.Instance.HiddenObjects != null)
            {
                Undo.RecordObjects(IsolateInfo.Instance.HiddenObjects.Cast <Object>().ToArray(), "DeIsolate");
                IsolateInfo.Show();
            }

            Undo.DestroyObjectImmediate(IsolateInfo.Instance.gameObject);
        }
Exemplo n.º 5
0
        private static void UpdateIsolation(List <GameObject> newItems)
        {
            if (!newItems.Any())
            {
                return;
            }
            Undo.RecordObject(IsolateInfo.Instance, "Isolate");
            Undo.RecordObjects(IsolateInfo.Instance.HiddenObjects.Cast <Object>().ToArray(), "Isolate");
            IsolateInfo.Show();
            IsolateInfo.Instance.FocusObjects = IsolateInfo.Instance.FocusObjects.Concat(newItems).Distinct().ToList();
            var newHiddenObjects = GetAllGameObjectsToHide();

            Undo.RecordObjects(newHiddenObjects.Except(IsolateInfo.Instance.HiddenObjects).Cast <Object>().ToArray(), "Isolate");
            IsolateInfo.Instance.HiddenObjects = newHiddenObjects;
            IsolateInfo.Hide();
        }
Exemplo n.º 6
0
        internal virtual Location getCurrentIsolateLocation(int i_id)
        {
            IsolateInfo ii = runningIsolates[i_id];

            Location where = null;
            try
            {
                Frame[] frames = ii.i_Session.getFrames();

                where = frames.Length > 0 ? frames[0].getLocation() : null;
            }
            catch (PlayerDebugException)
            {
                // where == null
            }
            return(where);
        }
Exemplo n.º 7
0
        private static void StartIsolation()
        {
            if (IsolateInfo.Instance)
            {
                Debug.LogWarning("Isolationist: Found previous isolation info. This shouldn't happen. Ending the previous isolation anyway.");
                EndIsolation();
            }

            if (EditorApplication.isPlayingOrWillChangePlaymode)
            {
                Debug.LogWarning("Isolationist: Can't isolate while playing. It'll break stuff!");
                return;
            }

            // Create new IsolateInfo object.
            var container = new GameObject("IsolationInfo")
            {
                hideFlags = HideFlags.HideInHierarchy
            };

            Undo.RegisterCreatedObjectUndo(container, "Isolate");
            IsolateInfo.Instance = container.AddComponent <IsolateInfo>();
            var focusList = IsolateInfo.Instance.FocusObjects = Selection.gameObjects.ToList();

            if (!_hideLights)
            {
                _lightTypeList.ForEach(t => focusList.AddRange(Object.FindObjectsOfType(t).Select <Object, GameObject>(ObjectToGO)));
            }

            if (!_hideCameras)
            {
                _cameraTypeList.ForEach(t => focusList.AddRange(Object.FindObjectsOfType(t).Select <Object, GameObject>(ObjectToGO)));
            }

            IsolateInfo.Instance.HiddenObjects = GetAllGameObjectsToHide();

            if (!IsolateInfo.Instance.HiddenObjects.Any())
            {
                Object.DestroyImmediate(container);
                Debug.LogWarning("Isolationist: Nothing to isolate.");
                return;
            }

            Undo.RecordObjects(IsolateInfo.Instance.HiddenObjects.Cast <Object>().ToArray(), "Isolate");
            IsolateInfo.Hide();
        }
Exemplo n.º 8
0
        /// <summary> Perform the tasks need for when an isolate is created
        /// </summary>
        internal virtual void dumpIsolateCreateEvent(IsolateCreateEvent e)
        {
            IsolateSession i_Session = m_Session.getWorkerSession(e.isolate.getId());

            i_Session.breakOnCaughtExceptions(true);

            IsolateInfo ii = addRunningIsolate(e.isolate.getId());

            ii.i_Session = i_Session;

            UpdateIsolateBreakpoints(m_BreakPointManager.BreakPoints, ii);

            i_Session.resume();

            if (ThreadsEvent != null)
            {
                ThreadsEvent(this);
            }
        }
Exemplo n.º 9
0
 private void UpdateIsolateBreakpoints(List <BreakPointInfo> breakpoints, IsolateInfo ii)
 {
     commonUpdateBreakpoints(breakpoints, ii.breakpointLocations, ii.i_Session);
 }
        private IsolateInfo addRunningIsolate(int i_id)
        {
            removeRunningIsolate(i_id);
            runningIsolates[i_id] = new IsolateInfo();

            return runningIsolates[i_id];
        }
 private void UpdateIsolateBreakpoints(List<BreakPointInfo> breakpoints, IsolateInfo ii)
 {
     commonUpdateBreakpoints(breakpoints, ii.breakpointLocations, ii.i_Session);
 }