コード例 #1
0
ファイル: PercentSliderDrawer.cs プロジェクト: Nama3/madrace
        public float GetElementHeight(MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute)
        {
            var propertyType = serializedField.GetElement(index).propertyType;

            return(propertyType != SerializedPropertyType.Integer && propertyType != SerializedPropertyType.Float
                ? MightyGUIUtilities.WARNING_HEIGHT
                : MightyGUIUtilities.FIELD_HEIGHT + MightyGUIUtilities.FIELD_SPACING);
        }
コード例 #2
0
        public float GetElementHeight(MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute)
        {
            var element = serializedField.GetElement(index);

            return(element.propertyType != SerializedPropertyType.String
                ? MightyGUIUtilities.WARNING_HEIGHT
                : MightyGUIUtilities.TextHeight(element.stringValue, 3) + MightyGUIUtilities.FIELD_HEIGHT +
                   MightyGUIUtilities.FIELD_SPACING * 2);
        }
コード例 #3
0
        public float GetElementHeight(MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute)
        {
            var element = serializedField.GetElement(index);

            return(element.propertyType != SerializedPropertyType.ObjectReference
                ? MightyGUIUtilities.WARNING_HEIGHT
                : !AssetPreview.GetAssetPreview(element.objectReferenceValue)
                    ? MightyGUIUtilities.FIELD_HEIGHT + MightyGUIUtilities.FIELD_SPACING
                    : 64);
        }
コード例 #4
0
        protected override float GetDecoratorHeight(MightySerializedField serializedField, int index, ShowAssetPreviewAttribute attribute)
        {
            var element = serializedField.GetElement(index);

            Texture2D preview;

            if (element.propertyType != SerializedPropertyType.ObjectReference || element.objectReferenceValue == null ||
                (preview = AssetPreview.GetAssetPreview(element.objectReferenceValue)) == null)
            {
                return(40);
            }
            return(GetClampedWidthAndHeight(preview.width, preview.height, attribute.Size).Item2 +
                   MightyGUIUtilities.FIELD_SPACING);
        }
コード例 #5
0
 public void DrawElement(GUIContent label, MightySerializedField serializedField, int index,
                         BasePropertyDrawerAttribute baseAttribute) =>
 DrawRotation2D(serializedField.GetElement(index), (Rotation2DAttribute)baseAttribute, label);
コード例 #6
0
 public void DrawElement(Rect position, MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute)
 => DrawAssetField(position, serializedField.GetElement(index), (AssetOnlyAttribute)baseAttribute);
コード例 #7
0
 public void DrawElement(GUIContent label, MightySerializedField serializedField, int index,
                         BasePropertyDrawerAttribute baseAttribute) =>
 DrawAssetField(serializedField.GetElement(index), (AssetOnlyAttribute)baseAttribute, label);
コード例 #8
0
 public float GetElementHeight(MightySerializedField serializedField, int index, BasePropertyDrawerAttribute attribute) =>
 IsPropertyTypeValid(serializedField.GetElement(index).propertyType)
         ? GetFieldHeight(attribute.Options)
         : MightyGUIUtilities.WARNING_HEIGHT;
コード例 #9
0
 public void DrawElement(Rect position, MightySerializedField serializedField, int index,
                         BasePropertyDrawerAttribute baseAttribute) => DrawField(position, serializedField.GetElement(index), baseAttribute.Options);
コード例 #10
0
ファイル: PercentSliderDrawer.cs プロジェクト: Nama3/madrace
 public void DrawElement(Rect position, MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute)
 => DrawSlider(position, serializedField.GetElement(index), (PercentSliderAttribute)baseAttribute);
コード例 #11
0
ファイル: LayerFieldDrawer.cs プロジェクト: Nama3/madrace
 public void DrawElement(MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) =>
 DrawLayerField(serializedField.GetElement(index), (LayerFieldAttribute)baseAttribute);
コード例 #12
0
 public void DrawElement(MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) =>
 DrawTagField(serializedField.GetElement(index), baseAttribute.Options);
コード例 #13
0
 protected override void DrawDecoratorElement(MightySerializedField serializedField, int index, ShowAssetPreviewAttribute attribute)
 => DrawPreview(serializedField.GetElement(index), attribute);
コード例 #14
0
 protected override Rect DrawDecoratorElement(Rect position, MightySerializedField serializedField, int index,
                                              ShowAssetPreviewAttribute attribute) =>
 DrawPreview(position, serializedField.GetElement(index), attribute);
コード例 #15
0
 public void DrawElement(Rect position, MightySerializedField serializedField, int index,
                         BasePropertyDrawerAttribute baseAttribute) =>
 DrawRotation2D(position, serializedField.GetElement(index), (Rotation2DAttribute)baseAttribute);
コード例 #16
0
 public void DrawElement(GUIContent label, MightySerializedField serializedField, int index,
                         BasePropertyDrawerAttribute baseAttribute) => DrawField(serializedField.GetElement(index), baseAttribute.Options, label);
コード例 #17
0
 public float GetElementHeight(MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) =>
 serializedField.GetElement(index).propertyType != SerializedPropertyType.Quaternion
         ? MightyGUIUtilities.WARNING_HEIGHT
         : MightyGUIUtilities.FIELD_HEIGHT + MightyGUIUtilities.FIELD_SPACING;
コード例 #18
0
ファイル: PercentSliderDrawer.cs プロジェクト: Nama3/madrace
 public void DrawElement(GUIContent label, MightySerializedField serializedField, int index,
                         BasePropertyDrawerAttribute baseAttribute) =>
 DrawSlider(serializedField.GetElement(index), (PercentSliderAttribute)baseAttribute, label);