示例#1
0
        void OnEnable()
        // ReSharper restore UnusedMember.Local
        {
            //Debug.Log("ComponentEditor OnEnable: " + target);
            Hide("margins"); // TEMP

            // Unity bug: checking a target causes error
            // Actually found the additional info:
            // "Instance of StageEditor couldn't be created because there is no script with that name."
            // the source of this error is because I'm recompiling the actual editor assembly (eDriven.Gui.Editor)
            // so doing this, Unity cannot find the appropriate editor class at a particular moment
            // when rebuilding scripts in the Playground, it works fine

            _adapterAnalysis = new AdapterAnalysis(target);

#if DEBUG
            if (DebugMode)
            {
                Debug.Log(string.Format(@"===== AdapterAnalysis =====
{0}", _adapterAnalysis));
            }
#endif

            Initialize();
            //Debug.Log(string.Format("OnEnable. Instance ID: {0}. isPlaying: {1}. isPlayingOrWillChangePlaymode: {2}.", target.GetInstanceID(), EditorApplication.isPlaying, EditorApplication.isPlayingOrWillChangePlaymode));

            if (EditorApplication.isPlaying && EditorSettings.WatchChanges)
            {
                PersistenceManager.Instance.Watch(target);
            }
        }
示例#2
0
        void OnEnable()
        // ReSharper restore UnusedMember.Local
        {
            //Debug.Log("ComponentEditor OnEnable: " + target);
            Hide("margins"); // TEMP

            // Unity bug: checking a target causes error
            // Actually found the additional info: 
            // "Instance of StageEditor couldn't be created because there is no script with that name."
            // the source of this error is because I'm recompiling the actual editor assembly (eDriven.Gui.Editor)
            // so doing this, Unity cannot find the appropriate editor class at a particular moment
            // when rebuilding scripts in the Playground, it works fine

            _adapterAnalysis = new AdapterAnalysis(target);

#if DEBUG
            if (DebugMode)
            {
                Debug.Log(string.Format(@"===== AdapterAnalysis =====
{0}", _adapterAnalysis));
            }
#endif

            Initialize();
            //Debug.Log(string.Format("OnEnable. Instance ID: {0}. isPlaying: {1}. isPlayingOrWillChangePlaymode: {2}.", target.GetInstanceID(), EditorApplication.isPlaying, EditorApplication.isPlayingOrWillChangePlaymode));

            if (EditorApplication.isPlaying && EditorSettings.WatchChanges)
            {
                PersistenceManager.Instance.Watch(target);
            }
        }