导入leg插件,完成腿部动画
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "AD_FimpoPropertyDraw",
|
||||
"references": [
|
||||
"GUID:7fe40b228d32d4d4e9b1cf8eb73412fd",
|
||||
"GUID:4d3c0eb3c5c6f2243952516f8611fff4"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 01bc8267011309640a207790fb2ae751
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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:
|
||||
@@ -0,0 +1,15 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace FIMSpace.FEditor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(FPD_LayersAttribute))]
|
||||
public class FPropDrawers_Layers : PropertyDrawer
|
||||
{
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
property.intValue = EditorGUI.LayerField(position, label, property.intValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52a8e6fabdf4924409d799b84baa67db
|
||||
timeCreated: 1543091521
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,107 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace FIMSpace.FEditor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(FPD_SuffixAttribute))]
|
||||
public class FPD_Suffix : PropertyDrawer
|
||||
{
|
||||
FPD_SuffixAttribute Attribute { get { return ((FPD_SuffixAttribute)base.attribute); } }
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
label = EditorGUI.BeginProperty(position, label, property);
|
||||
position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
|
||||
|
||||
float sliderVal = property.floatValue;
|
||||
|
||||
GUIContent suff = new GUIContent(Attribute.Suffix);
|
||||
Vector2 fieldS = EditorStyles.label.CalcSize(suff);
|
||||
|
||||
float fieldSize = 34 + fieldS.x + Attribute.widerField;
|
||||
var percField = new Rect(position.x + position.width - fieldSize + 5, position.y, fieldSize, position.height);
|
||||
Rect floatField = position;
|
||||
|
||||
bool editable = Attribute.editableValue;
|
||||
if (GUI.enabled == false) editable = false;
|
||||
|
||||
if (editable)
|
||||
{
|
||||
floatField = new Rect(position.x + position.width - fieldSize + 2, position.y, fieldSize - (fieldS.x + 4), position.height);
|
||||
percField.position = new Vector2(position.x + position.width - fieldS.x, percField.position.y);
|
||||
percField.width = fieldS.x;
|
||||
}
|
||||
|
||||
position.width -= fieldSize + 3;
|
||||
sliderVal = GUI.HorizontalSlider(position, property.floatValue, Attribute.Min, Attribute.Max);
|
||||
|
||||
float pre, value;
|
||||
int indent;
|
||||
|
||||
indent = EditorGUI.indentLevel;
|
||||
EditorGUI.indentLevel = 0;
|
||||
|
||||
switch (Attribute.Mode)
|
||||
{
|
||||
case FPD_SuffixAttribute.SuffixMode.From0to100:
|
||||
|
||||
if (!editable)
|
||||
EditorGUI.LabelField(percField, Mathf.Round(sliderVal / Attribute.Max * 100f).ToString() + Attribute.Suffix);
|
||||
else
|
||||
{
|
||||
pre = Mathf.Round(sliderVal / Attribute.Max * 100f);
|
||||
value = EditorGUI.FloatField(floatField, Mathf.Round(sliderVal / Attribute.Max * 100f));
|
||||
if (value != pre) sliderVal = value / 100f;
|
||||
|
||||
EditorGUI.LabelField(percField, Attribute.Suffix);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case FPD_SuffixAttribute.SuffixMode.PercentageUnclamped:
|
||||
|
||||
if (!editable)
|
||||
EditorGUI.LabelField(percField, Mathf.Round(sliderVal * 100f).ToString() + Attribute.Suffix);
|
||||
else
|
||||
{
|
||||
pre = Mathf.Round(sliderVal * 100f);
|
||||
value = EditorGUI.FloatField(floatField, Mathf.Round(sliderVal * 100f));
|
||||
if (value != pre) sliderVal = value / 100f;
|
||||
|
||||
EditorGUI.LabelField(percField, Attribute.Suffix);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case FPD_SuffixAttribute.SuffixMode.FromMinToMax:
|
||||
|
||||
pre = sliderVal;
|
||||
value = EditorGUI.FloatField(floatField, sliderVal);
|
||||
if (value != pre) sliderVal = value;
|
||||
|
||||
EditorGUI.LabelField(percField, Attribute.Suffix);
|
||||
|
||||
break;
|
||||
|
||||
case FPD_SuffixAttribute.SuffixMode.FromMinToMaxRounded:
|
||||
|
||||
pre = Mathf.Round(sliderVal);
|
||||
value = EditorGUI.FloatField(floatField, Mathf.Round(sliderVal));
|
||||
if (value != pre) sliderVal = value;
|
||||
|
||||
EditorGUI.LabelField(percField, Attribute.Suffix);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
property.floatValue = sliderVal;
|
||||
EditorGUI.indentLevel = indent;
|
||||
|
||||
EditorGUI.EndProperty();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da2fab391c355e24aa48ab803006c44f
|
||||
timeCreated: 1543091521
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user