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(); }
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(); }
public BaseDrawer() { if (prefs == null) { prefs = BetterPrefs.GetEditorInstance(); } if (foldouts == null) { foldouts = new Foldouts(prefs); } }
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 }
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, ""); }
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); } }
public static void UseRabbitGUI() { BetterPrefs.GetEditorInstance().Bools[guiKey] = false; }
public static void UseUnityGUI() { BetterPrefs.GetEditorInstance().Bools[guiKey] = true; }
protected override void Copy() { int key = RuntimeHelper.CombineHashCodes(id, "Clip"); BetterPrefs.GetEditorInstance().Vector3s[key] = memberValue; }
protected override Vector3 Paste() { int key = RuntimeHelper.CombineHashCodes(id, "Clip"); return(BetterPrefs.GetEditorInstance().Vector3s[key, memberValue]); }