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.
 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;
 }
Beispiel #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;
 }
Beispiel #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;
            }
 public Foldout(fiGUIContent label, FontStyle fontStyle, tkControl <T, TContext> control)
     : this(label, fontStyle, true, control)
 {
 }
 public Foldout(fiGUIContent label, tkControl <T, TContext> control)
     : this(label, FontStyle.Normal, control)
 {
 }
Beispiel #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)));
 }
Beispiel #7
0
 public PropertyEditor(fiGUIContent label, string memberName)
     : this(memberName) {
     _label = label;
 }
Beispiel #8
0
 public Button(fiGUIContent label, Action <T, TContext> onClick)
     : this(Val(label), onClick)
 {
 }
Beispiel #9
0
 public Label(fiGUIContent label, FontStyle fontStyle, tkControl <T, TContext> control)
     : this(Val(label), fontStyle, control)
 {
 }
Beispiel #10
0
 public Label(fiGUIContent label, FontStyle fontStyle) :
     this(label, fontStyle, null)
 {
 }
Beispiel #11
0
 public Label(fiGUIContent label) :
     this(label, FontStyle.Normal, null)
 {
 }