Пример #1
0
        private void OnEnable()
        {
            if (prefs == null)
            {
                prefs = BetterPrefs.GetEditorInstance();
            }

            if (foldouts == null)
            {
                foldouts = new Foldouts(prefs);
            }

            var component = target as Component;

            gameObject = component == null ? null : component.gameObject;

            targetType = target.GetType();

            id = RuntimeHelper.GetTargetID(target);

            _useUnityGUI = useUnityGUI;
            gui          = _useUnityGUI ? (BaseGUI) new TurtleGUI() : new RabbitGUI();

            Initialize();

            gui.OnEnable();
        }
Пример #2
0
        private void OnEnable()
        {
            if (prefs == null)
            {
                prefs = BetterPrefs.GetEditorInstance();
            }

            if (foldouts == null)
            {
                foldouts = new Foldouts();
            }

            var component = target as Component;

            gameObject = component == null ? null : component.gameObject;

            targetType = target.GetType();

            id = RuntimeHelper.GetTargetID(target);

            Initialize();

            var rabbit = gui as RabbitGUI;

            if (rabbit != null && _membersDrawnByUnityLayout.Length > 0)
            {
                rabbit.OnFinishedLayoutReserve = DoUnityLayout;
            }

            gui.OnEnable();
        }
Пример #3
0
 public BaseDrawer()
 {
     if (prefs == null)
     {
         prefs = BetterPrefs.GetEditorInstance();
     }
     if (foldouts == null)
     {
         foldouts = new Foldouts(prefs);
     }
 }
Пример #4
0
        public RabbitGUI()
        {
            _currentPhase = GUIPhase.Layout;
            _controls     = new List <GUIControl>();
            _blocks       = new List <GUIBlock>();
            _blockStack   = new Stack <GUIBlock>();
            _prefs        = BetterPrefs.GetEditorInstance();

            #if dbg_level_1
            Debug.Log("Instantiated Rabbit");
            #endif
        }
Пример #5
0
        public TextFilter(string[] values, int id, bool initialToggle, Action <string> setValue)
        {
            _values   = values;
            _setValue = setValue;
            _id       = RuntimeHelper.CombineHashCodes(id, "Filter");

            if (_prefs == null)
            {
                _prefs = BetterPrefs.GetEditorInstance();
            }

            _toggle  = _prefs.Bools.ValueOrDefault(this._id, initialToggle);
            _pattern = _prefs.Strings.ValueOrDefault(this._id, "");
        }
Пример #6
0
 public bool this[int key]
 {
     get
     {
         var prefs = BetterPrefs.GetEditorInstance();
         return(prefs.Bools.ValueOrDefault(key));
     }
     set
     {
         var prefs = BetterPrefs.GetEditorInstance();
         prefs.Bools[key] = value;
         EditorUtility.SetDirty(prefs);
     }
 }
Пример #7
0
 public static void UseRabbitGUI()
 {
     BetterPrefs.GetEditorInstance().Bools[guiKey] = false;
 }
Пример #8
0
 public static void UseUnityGUI()
 {
     BetterPrefs.GetEditorInstance().Bools[guiKey] = true;
 }
Пример #9
0
        protected override void Copy()
        {
            int key = RuntimeHelper.CombineHashCodes(id, "Clip");

            BetterPrefs.GetEditorInstance().Vector3s[key] = memberValue;
        }
Пример #10
0
        protected override Vector3 Paste()
        {
            int key = RuntimeHelper.CombineHashCodes(id, "Clip");

            return(BetterPrefs.GetEditorInstance().Vector3s[key, memberValue]);
        }