阶段性完成
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomPropertyDrawer(typeof(FPD_FixedCurveWindowAttribute))]
|
||||
public class FPD_FixedCurveWindow : PropertyDrawer
|
||||
{
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
FPD_FixedCurveWindowAttribute att = attribute as FPD_FixedCurveWindowAttribute;
|
||||
|
||||
if (property.propertyType == SerializedPropertyType.AnimationCurve)
|
||||
{
|
||||
EditorGUI.CurveField(position, property, att.Color, new Rect(att.StartTime, att.StartValue, att.EndTime - att.StartTime , att.EndValue - att.StartValue ), label );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f475817a21ad57f43bc7954b64fb3ec5
|
||||
timeCreated: 1554395276
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,31 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace FIMSpace.FEditor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(FPD_HeaderAttribute))]
|
||||
public class FPD_Header : DecoratorDrawer
|
||||
{
|
||||
public static GUIStyle HeaderStyle { get { if (_headerStyle == null) { _headerStyle = new GUIStyle(EditorStyles.helpBox); _headerStyle.fontStyle = FontStyle.Bold; _headerStyle.alignment = TextAnchor.MiddleCenter; _headerStyle.fontSize = 11; } return _headerStyle; } }
|
||||
private static GUIStyle _headerStyle;
|
||||
|
||||
public override void OnGUI(Rect position)
|
||||
{
|
||||
FPD_HeaderAttribute att = (FPD_HeaderAttribute)base.attribute;
|
||||
|
||||
Rect pos = position; pos.height = base.GetHeight() + att.Height;
|
||||
|
||||
pos.y += att.UpperPadding;
|
||||
|
||||
GUI.Label(pos, new GUIContent(att.HeaderText), HeaderStyle);
|
||||
}
|
||||
|
||||
public override float GetHeight()
|
||||
{
|
||||
FPD_HeaderAttribute att = (FPD_HeaderAttribute)base.attribute;
|
||||
return base.GetHeight() + att.Height + att.BottomPadding + att.UpperPadding;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d68d9ee739e39364da05ebcb62c94d46
|
||||
timeCreated: 1543091521
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user