-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start PowerEnum feature; fixes to generic animation; new issues with timeline applying event though not on clip; bunch of misc stuff
- Loading branch information
Showing
32 changed files
with
2,597 additions
and
1,569 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEditor; | ||
using UnityEngine; | ||
using AnimationUtility = TMPEffects.TMPAnimations.AnimationUtility; | ||
|
||
[CustomPropertyDrawer(typeof(AnimationUtility.FancyAnimationCurve))] | ||
public class FancyAnimationCurveDrawer : PropertyDrawer | ||
{ | ||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) | ||
{ | ||
EditorGUI.BeginProperty(position, label, property); | ||
|
||
var rect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight); | ||
|
||
var width = EditorStyles.label.CalcSize(label); | ||
var ctrlRect = EditorGUI.PrefixLabel(rect, GUIUtility.GetControlID(FocusType.Passive, rect), label); | ||
var foldoutRect = new Rect(rect.x + width.x + 15, rect.y, 20, EditorGUIUtility.singleLineHeight); | ||
|
||
var curveProp = property.FindPropertyRelative("curve"); | ||
|
||
curveProp.isExpanded = EditorGUI.Foldout(foldoutRect, curveProp.isExpanded, new GUIContent("")); | ||
|
||
// TODO Strange ass workaround for offset created by EditorGUI.PrefixLabel | ||
EditorGUI.indentLevel--; | ||
EditorGUI.indentLevel--; | ||
EditorGUI.PropertyField(ctrlRect, curveProp, new GUIContent("")); | ||
EditorGUI.indentLevel++; | ||
EditorGUI.indentLevel++; | ||
|
||
if (curveProp.isExpanded) | ||
{ | ||
EditorGUI.indentLevel++; | ||
rect.y += EditorGUIUtility.singleLineHeight; | ||
EditorGUI.PropertyField(rect, property.FindPropertyRelative("offsetType")); | ||
rect.y += EditorGUIUtility.singleLineHeight; | ||
EditorGUI.PropertyField(rect, property.FindPropertyRelative("wrapMode")); | ||
rect.y += EditorGUIUtility.singleLineHeight; | ||
EditorGUI.PropertyField(rect, property.FindPropertyRelative("uniformity")); | ||
EditorGUI.indentLevel--; | ||
} | ||
|
||
EditorGUI.EndProperty(); | ||
} | ||
|
||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) | ||
{ | ||
var curveProp = property.FindPropertyRelative("curve"); | ||
if (curveProp.isExpanded) | ||
{ | ||
return EditorGUIUtility.singleLineHeight * 4; | ||
} | ||
|
||
return EditorGUIUtility.singleLineHeight; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.