예제 #1
0
        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);
        }
예제 #2
0
        public ToggleView(string text, bool initValue = false)
        {
            Text   = text;
            Toggle = new Property <bool>(initValue);

            Style = new GUIStyleProperty(() => GUI.skin.toggle);
        }
예제 #3
0
        public ToolbarView()
        {
            IndexProperty = new Property <int>(0);

            IndexProperty.Bind(index => MenuSelected[index].Invoke(MenuNames[index]));

            Style = new GUIStyleProperty(() => GUI.skin.button);
        }
예제 #4
0
 public BoxView()
 {
     mStyleProperty = new GUIStyleProperty(() =>
     {
         // Box 的颜色保持和文本的颜色一致
         var boxStyle = new GUIStyle(GUI.skin.box)
         {
             normal = { textColor = GUI.skin.label.normal.textColor }
         };
         return(boxStyle);
     });
 }
예제 #5
0
        public LabelView(string content)
        {
            Content = content;

            mStyleProperty = new GUIStyleProperty(() => new GUIStyle(GUI.skin.label));
        }
예제 #6
0
 public Label()
 {
     mStyleProperty = new GUIStyleProperty(() => new GUIStyle(GUI.skin.label));
 }
예제 #7
0
 public EnumPopupView(Enum initValue)
 {
     ValueProperty       = new Property <Enum>(initValue);
     ValueProperty.Value = initValue;
     Style = new GUIStyleProperty(() => EditorStyles.popup);
 }
예제 #8
0
 public TextArea()
 {
     Content        = new Property <string>(string.Empty);
     mStyleProperty = new GUIStyleProperty(() => GUI.skin.textArea);
 }
예제 #9
0
        public Toggle()
        {
            ValueProperty = new Property <bool>(false);

            Style = new GUIStyleProperty(() => GUI.skin.toggle);
        }
예제 #10
0
 public IPopup ToolbarStyle()
 {
     mStyleProperty = new GUIStyleProperty(() => EditorStyles.toolbarPopup);
     return(this);
 }
예제 #11
0
 protected PopupView()
 {
     mStyleProperty = new GUIStyleProperty(() => EditorStyles.popup);
 }
예제 #12
0
 public BoxWithRect()
 {
     mStyleProperty = new GUIStyleProperty(() => GUI.skin.box);
 }