public TreeNode(bool spread, string content, int indent = 0, bool autosaveSpreadState = false) { if (autosaveSpreadState) { spread = EditorPrefs.GetBool(content, spread); } Content = content; Spread = new Property <bool>(spread); Style = new GUIStyleProperty(() => EditorStyles.foldout); mFirstLine.AddTo(this); mFirstLine.AddChild(EasyIMGUI.Space().Pixel(indent)); if (autosaveSpreadState) { Spread.Bind(value => EditorPrefs.SetBool(content, value)); } EasyIMGUI.Custom().OnGUI(() => { Spread.Value = EditorGUILayout.Foldout(Spread.Value, Content, true, Style.Value); }) .AddTo(mFirstLine); EasyIMGUI.Custom().OnGUI(() => { if (Spread.Value) { mSpreadView.DrawGUI(); } }).AddTo(this); }
public ToggleView(string text, bool initValue = false) { Text = text; Toggle = new Property <bool>(initValue); Style = new GUIStyleProperty(() => GUI.skin.toggle); }
public ToolbarView() { IndexProperty = new Property <int>(0); IndexProperty.Bind(index => MenuSelected[index].Invoke(MenuNames[index])); Style = new GUIStyleProperty(() => GUI.skin.button); }
public BoxView() { mStyleProperty = new GUIStyleProperty(() => { // Box 的颜色保持和文本的颜色一致 var boxStyle = new GUIStyle(GUI.skin.box) { normal = { textColor = GUI.skin.label.normal.textColor } }; return(boxStyle); }); }
public LabelView(string content) { Content = content; mStyleProperty = new GUIStyleProperty(() => new GUIStyle(GUI.skin.label)); }
public Label() { mStyleProperty = new GUIStyleProperty(() => new GUIStyle(GUI.skin.label)); }
public EnumPopupView(Enum initValue) { ValueProperty = new Property <Enum>(initValue); ValueProperty.Value = initValue; Style = new GUIStyleProperty(() => EditorStyles.popup); }
public TextArea() { Content = new Property <string>(string.Empty); mStyleProperty = new GUIStyleProperty(() => GUI.skin.textArea); }
public Toggle() { ValueProperty = new Property <bool>(false); Style = new GUIStyleProperty(() => GUI.skin.toggle); }
public IPopup ToolbarStyle() { mStyleProperty = new GUIStyleProperty(() => EditorStyles.toolbarPopup); return(this); }
protected PopupView() { mStyleProperty = new GUIStyleProperty(() => EditorStyles.popup); }
public BoxWithRect() { mStyleProperty = new GUIStyleProperty(() => GUI.skin.box); }