Exemplo n.º 1
0
        protected override EditorGUIElement PushState()
        {
            EditTarget value;
            EditProperty_Single_Object      property  = GetEditPropertyObject();
            EditorGUIElement_Container_Auto container = new EditorGUIElement_Container_Auto_Simple_VerticalStrip();

            if (property.HasCustomAttributeOfType <PolymorphicFieldAttribute>(true))
            {
                EditorGUIElement_Container_Flow_Line strip = container.AddChild(new EditorGUIElement_Container_Flow_Line());

                strip.AddWeightedChild(1.0f,
                                       new EditorGUIElement_Popup_ProcessOperation <Type>(
                                           Types.GetFilteredTypes(
                                               Filterer_Type.CanBeTreatedAs(property.GetPropertyType()),
                                               Filterer_Type.IsConcreteClass()
                                               ).NaturalSort(t => t.FullName),
                                           t => property.CreateContents(t, true),
                                           (out Type t) => property.TryGetContentsType(out t)
                                           )
                                       );

                strip.AddFixedChild(20.0f,
                                    new EditorGUIElement_Button("X", delegate() {
                    property.ClearContents(true);
                })
                                    );
            }
            else if (property.HasCustomAttributeOfType <MonomorphicFieldAttribute>(true))
            {
                property.EnsureContents(
                    property.GetCustomAttributeOfType <MonomorphicFieldAttribute>(true)
                    .GetTargetType(),
                    false
                    );
            }

            if (property.TryGetContents(out value))
            {
                container.AddChild(new EditorGUIElement_Complex_EditTarget(value));
            }

            return(container);
        }
Exemplo n.º 2
0
 public EditorGUIElement_Complex_EditPropertySingleObject(EditProperty_Single_Object p)
 {
     property = p;
 }
Exemplo n.º 3
0
 public EditorGUIElement_Complex_EditPropertySingleObject_Generic(EditProperty_Single_Object p) : base(p)
 {
 }