Пример #1
0
        public EditorGUIElement_EditPropertySingleValue_Basic_BuiltIn_String(EditProperty_Single_Value p) : base(p)
        {
            use_word_wrap = p.HasCustomAttributeOfType <WordWrapAttribute>(true);

            multiline_attribute      = p.GetCustomAttributeOfType <MultilineAttribute>(true);
            auto_multiline_attribute = p.GetCustomAttributeOfType <AutoMultilineAttribute>(true);
        }
Пример #2
0
        protected override LabeledSpritePoint DrawValueInternal(Rect rect, LabeledSpritePoint value)
        {
            string  label    = value.GetLabel();
            Vector2 position = value.GetPosition();

            EditProperty_Single_Value sprite_property = GetProperty().GetTarget().ForcePropertyValue("target_asset");

            Rect label_rect;
            Rect position_rect;

            rect.SplitByXLeftPercent(0.4f, out rect, out position_rect);
            rect.SplitByYBottomOffset(LINE_HEIGHT, out label_rect, out rect);

            label = EditorGUIExtensions.TextField(label_rect, label);

            if (sprite_property != null)
            {
                Sprite sprite;

                if (sprite_property.TryGetContentValues <Sprite>(out sprite))
                {
                    position_rect = GUIExtensions.DrawSprite(position_rect, sprite);

                    position = EditorGUIExtensions.XYControl(
                        position_rect,
                        position,
                        new FloatRange(0.0f, 1.0f),
                        new FloatRange(0.0f, 1.0f)
                        );
                }
            }

            return(new LabeledSpritePoint(label, position));
        }
Пример #3
0
 public EditorGUIElement_Complex_EditPropertySingleValue_CustomAsset(EditProperty_Single_Value p) : base(p)
 {
 }
Пример #4
0
 public EditorGUIElement_EditPropertySingleValue_Combo_TypeMethodInfo(EditProperty_Single_Value p, EditProperty_Single_Value t) : base(p)
 {
     type_property = t;
 }
Пример #5
0
 public EditorGUIElement_Composite_EditPropertySingleValue_Generic(EditProperty_Single_Value p) : base(p)
 {
 }
Пример #6
0
 public EditorGUIElement_EditPropertySingleValue(EditProperty_Single_Value p)
 {
     property = p;
 }
Пример #7
0
 public EditorGUIElement_EditPropertySingleValue_Popup(EditProperty_Single_Value p) : base(p)
 {
 }
Пример #8
0
 public EditorGUIElement_Foldout_EditPropertySingleValue(EditProperty_Single_Value p, string t, T c, float h) : base(t, c, h)
 {
     edit_property_value = p;
 }
Пример #9
0
 public EditorGUIElement_EditPropertySingleValue_Popup_SortingLayerEX(EditProperty_Single_Value p) : base(p)
 {
 }
Пример #10
0
 public EditorGUIElement_EditPropertySingleValue_Popup_TypeSubType(EditProperty_Single_Value p, EditProperty_Single_Value t) : base(p)
 {
     type_property = t;
 }
Пример #11
0
 public EditorGUIElement_Complex_EditPropertySingleValue_TypedObject(EditProperty_Single_Value p, EditProperty_Single_Value t) : base(p)
 {
     type_property = t;
 }
Пример #12
0
 public EditorGUIElement_EditPropertySingleValue_Popup_GameObjectComponentType(EditProperty_Single_Value p, EditProperty_Single_Value g) : base(p)
 {
     game_object_property = g;
 }
Пример #13
0
 public EditorGUIElement_EditPropertySingleValue_Basic_Sprite(EditProperty_Single_Value p) : base(p)
 {
 }
Пример #14
0
 public EditorGUIElement_EditPropertySingleValue_Browse_AudioClip(EditProperty_Single_Value p) : base(p)
 {
 }
Пример #15
0
 public EditorGUIElement_Foldout_EditPropertySingleValue_VerticalStrip(EditProperty_Single_Value s, string t) : this(s, t, EditorGUIElement_Single.DEFAULT_HEIGHT)
 {
 }
Пример #16
0
 public EditorGUIElement_Composite_EditPropertySingleValue_UnityObject(EditProperty_Single_Value p) : this(p, p.GetPropertyType())
 {
 }
Пример #17
0
 public BuiltIn(EditProperty_Single_Value p, Type s) : base(p)
 {
     specific_type = s;
 }
Пример #18
0
 public EditorGUIElement_EditPropertySingleValue_Basic_BuiltIn_Number(EditProperty_Single_Value p) : base(p)
 {
     range_attribute = p.GetCustomAttributeOfType <RangeAttribute>(true);
 }
Пример #19
0
 public EditorGUIElement_Foldout_EditPropertySingleValue(EditProperty_Single_Value p, string t, T c) : this(p, t, c, EditorGUIElement_Single.DEFAULT_HEIGHT)
 {
 }
Пример #20
0
 public EditorGUIElement_EditPropertySingleValue_Basic_BuiltIn_Number_Long(EditProperty_Single_Value p) : base(p)
 {
 }
Пример #21
0
 public EditorGUIElement_EditPropertySingleValue_Basic_BuiltIn(EditProperty_Single_Value p) : base(p)
 {
     label = new EditorGUIElementAttachment_Singular_Label_GUIContent_Inline();
 }
Пример #22
0
 public EditorGUIElement_EditPropertySingleValue_Combo_Type(EditProperty_Single_Value p) : base(p)
 {
 }
Пример #23
0
 public EditorGUIElement_EditPropertySingleValue_Selector_Asset(EditProperty_Single_Value p, bool non_null) : base(p)
 {
     should_force_non_null = non_null;
 }
Пример #24
0
 public EditorGUIElement_EditPropertySingleValue_Browse(EditProperty_Single_Value p, Predicate <AssetInfo> pre) : base(p)
 {
     predicate = pre;
 }
Пример #25
0
 public EditorGUIElement_EditPropertySingleValue_Basic_OctoSubTile(EditProperty_Single_Value p) : base(p)
 {
 }
Пример #26
0
 public EditorGUIElement_EditPropertySingleValue_Browse(EditProperty_Single_Value p) : this(p, a => true)
 {
 }
Пример #27
0
 public EditorGUIElement_Complex_EditPropertySingleValue_ScriptletArgument(EditProperty_Single_Value p) : base(p)
 {
 }
Пример #28
0
 public EditorGUIElement_EditPropertySingleValue_Popup_GamepadStickId(EditProperty_Single_Value p) : base(p)
 {
 }
Пример #29
0
        protected override EditorGUIElement PushState()
        {
            CustomAsset asset;
            EditProperty_Single_Value property = GetProperty();

            Type field_type = property.GetPropertyType();

            EditorGUIElement_Container_Auto      container      = new EditorGUIElement_Container_Auto_Simple_VerticalStrip();
            EditorGUIElement_Container_Flow_Line type_container = container.AddChild(new EditorGUIElement_Container_Flow_Line());

            if (property.TryGetContentValues <CustomAsset>(out asset, true))
            {
                switch (asset.GetAssetType())
                {
                case AssetType.None:
                case AssetType.External:
                    type_container.AddWeightedChild(1.0f,
                                                    new EditorGUIElement_EditPropertySingleValue_Selector_Asset(property, false)
                                                    );
                    break;

                case AssetType.Internal:
                    type_container.AddWeightedChild(1.0f,
                                                    new EditorGUIElement_Popup_ProcessOperation <Type>(
                                                        GetInternalCustomAssetTypes(field_type),
                                                        t => property.SetContentValues(CustomAssets.CreateInternalCustomAsset(t)),
                                                        (out Type t) => property.TryGetContentsType(out t)
                                                        )
                                                    );
                    break;
                }

                type_container.AddFixedChild(64.0f, new EditorGUIElement_Process(delegate(Rect rect) {
                    AssetType new_type = EditorGUIExtensions.EnumPopup(rect, asset.GetAssetType());

                    if (asset.GetAssetType() != new_type)
                    {
                        switch (new_type)
                        {
                        case AssetType.None:
                            property.SetContentValues(null);
                            break;

                        case AssetType.External:
                            property.SetContentValues(
                                CustomAssets.GetExternalCustomAssetsOfType(field_type)
                                .GetFirst()
                                );
                            break;

                        case AssetType.Internal:
                            property.SetContentValues(
                                CustomAssets.CreateInternalCustomAsset(
                                    GetInternalCustomAssetTypes(field_type)
                                    .GetFirst()
                                    )
                                );
                            break;
                        }
                    }
                }));

                if (asset != null && asset.IsInternalAsset())
                {
                    container.AddChild(new EditorGUIElement_Complex_EditTarget(new EditTarget(asset)));
                }
            }

            return(container);
        }
Пример #30
0
 public EditorGUIElement_Composite_EditPropertySingleValue_UnityObject(EditProperty_Single_Value p, Type s) : base(p)
 {
     specific_type = s;
 }