Exemplo n.º 1
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();
        }
Exemplo n.º 2
0
 public BaseDrawer()
 {
     if (prefs == null)
         prefs = BetterPrefs.GetEditorInstance();
     if (foldouts == null)
         foldouts = new Foldouts();
 }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
0
 public MemberCategory(string fullPath, List <ICanBeDrawn> members, float displayOrder, string id, BetterPrefs prefs)
 {
     Members       = members;
     DisplayOrder  = displayOrder;
     this.prefs    = prefs;
     this.fullPath = fullPath;
     this.name     = FullPath.Substring(FullPath.LastIndexOf('/') + 1);
     this.id       = id + fullPath;
     Indent        = true;
 }
Exemplo n.º 5
0
 public BaseDrawer()
 {
     if (prefs == null)
     {
         prefs = BetterPrefs.GetEditorInstance();
     }
     if (foldouts == null)
     {
         foldouts = new Foldouts(prefs);
     }
 }
Exemplo n.º 6
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
        }
Exemplo n.º 7
0
        public MembersCategory(string fullPath, List <MemberInfo> members, float displayOrder, int id, BetterPrefs prefs)
        {
            Members       = members;
            DisplayOrder  = displayOrder;
            this.prefs    = prefs;
            this.FullPath = fullPath;
            this.Name     = FullPath.Substring(FullPath.LastIndexOf('/') + 1);
            this.id       = id + fullPath.GetHashCode();
            Indent        = true;

            NestedCategories = new List <MembersCategory>();
        }
Exemplo n.º 8
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, "");
        }
Exemplo n.º 9
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);
     }
 }
Exemplo n.º 10
0
 public static void UseRabbitGUI()
 {
     BetterPrefs.GetEditorInstance().Bools[guiKey] = false;
 }
Exemplo n.º 11
0
 public static void UseUnityGUI()
 {
     BetterPrefs.GetEditorInstance().Bools[guiKey] = true;
 }
Exemplo n.º 12
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);

            Initialize();

            var rabbit = gui as RabbitGUI;
            if (rabbit != null && _membersDrawnByUnityLayout.Length > 0)
                rabbit.OnFinishedLayoutReserve = DoUnityLayout;

            gui.OnEnable();
        }
Exemplo n.º 13
0
        protected override void Copy()
        {
            int key = RuntimeHelper.CombineHashCodes(id, "Clip");

            BetterPrefs.GetEditorInstance().Vector3s[key] = memberValue;
        }
Exemplo n.º 14
0
        protected override Vector3 Paste()
        {
            int key = RuntimeHelper.CombineHashCodes(id, "Clip");

            return(BetterPrefs.GetEditorInstance().Vector3s[key, memberValue]);
        }
Exemplo n.º 15
0
 public Foldouts(BetterPrefs prefs)
 {
     this.prefs = prefs;
 }
Exemplo n.º 16
0
 public Foldouts(BetterPrefs prefs)
 {
     this.prefs = prefs;
 }