This is a wrapper that will generate Unity GUIContent instances. This class has an implicit conversion from a string so that it is easy to easily construct GUIContents that just have a label.
Exemplo n.º 1
0
 public Foldout(fiGUIContent label, FontStyle fontStyle, bool defaultToExpanded, tkControl <T, TContext> control)
 {
     _label        = label;
     _foldoutStyle = new GUIStyle(fiLateBindings.EditorStyles.foldout)
     {
         fontStyle = fontStyle
     };
     _defaultToExpanded = defaultToExpanded;
     _control           = control;
 }
Exemplo n.º 2
0
 public PropertyEditor(
     fiGUIContent label,
     Type fieldType, MemberInfo attributes,
     Func <T, TContext, object> getValue, Action <T, TContext, object> setValue)
 {
     _label      = label;
     _fieldType  = fieldType;
     _attributes = attributes;
     _getValue   = getValue;
     _setValue   = setValue;
 }
Exemplo n.º 3
0
            private void InitializeFromMemberName(string memberName)
            {
                var property = InspectedType.Get(typeof(T)).GetPropertyByName(memberName);

                if (property == null)
                {
                    _errorMessage = "Unable to locate member `" + memberName + "` on type `" + typeof(T).CSharpName() + "`";
                    _fieldType    = typeof(T);
                    _attributes   = null;
                    _getValue     = (o, c) => default(T);
                    _setValue     = (o, c, v) => { };
                    _label        = memberName + " (unable to locate)";
                    return;
                }

                _fieldType  = property.StorageType;
                _attributes = property.MemberInfo;
                _getValue   = (o, c) => property.Read(o);
                _setValue   = (o, c, v) => property.Write(o, v);
                _label      = property.DisplayName;
            }
Exemplo n.º 4
0
 public Foldout(fiGUIContent label, FontStyle fontStyle, tkControl <T, TContext> control)
     : this(label, fontStyle, true, control)
 {
 }
Exemplo n.º 5
0
 public Foldout(fiGUIContent label, tkControl <T, TContext> control)
     : this(label, FontStyle.Normal, control)
 {
 }
Exemplo n.º 6
0
 public static PropertyEditor Create <TEdited>(fiGUIContent label, Func <T, TContext, TEdited> getValue, Action <T, TContext, TEdited> setValue)
 {
     return(new PropertyEditor(label, typeof(TEdited), null, (o, c) => getValue(o, c), (o, c, v) => setValue(o, c, (TEdited)v)));
 }
Exemplo n.º 7
0
 public PropertyEditor(fiGUIContent label, string memberName)
     : this(memberName) {
     _label = label;
 }
Exemplo n.º 8
0
 public Button(fiGUIContent label, Action <T, TContext> onClick)
     : this(Val(label), onClick)
 {
 }
Exemplo n.º 9
0
 public Label(fiGUIContent label, FontStyle fontStyle, tkControl <T, TContext> control)
     : this(Val(label), fontStyle, control)
 {
 }
Exemplo n.º 10
0
 public Label(fiGUIContent label, FontStyle fontStyle) :
     this(label, fontStyle, null)
 {
 }
Exemplo n.º 11
0
 public Label(fiGUIContent label) :
     this(label, FontStyle.Normal, null)
 {
 }