You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 604c122
Browse filesBrowse the repository at this point in the historyBrowse files
Move the Custom tab's add buttons into the content
The empty state shows the two kinds of custom animation as cards, and the add
buttons sit under the last animation; the action bar goes to Generate. The avatar
bar's buttons size to their text so Use Selection isn't clipped.
Copy file name to clipboardExpand all lines: Packages/net.pawlygon.unitytools/Editor/FaceTrackingExtras.Custom.cs
+60-9Lines changed: 60 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -72,31 +72,82 @@ private void DrawCustomTab()
72
72
73
73
if(profile.customAnimations.Count==0)
74
74
{
75
-
EditorGUILayout.LabelField("No custom animations yet. Add one below.",PawlygonEditorUI.SubLabelStyle);
75
+
EditorGUILayout.Space(8f);
76
+
DrawAddChoices();
76
77
}
77
78
}
78
79
80
+
if(profile.customAnimations.Count==0)return;
81
+
79
82
for(inti=0;i<profile.customAnimations.Count;i++)
80
83
{
81
84
EditorGUILayout.Space(6f);
82
85
DrawCustomAnimationCard(i,catalog);
83
86
}
87
+
88
+
EditorGUILayout.Space(6f);
89
+
using(newEditorGUILayout.HorizontalScope())
90
+
{
91
+
if(GUILayout.Button(newGUIContent("+ Follow a Parameter",FollowChoiceHint),GUILayout.Height(24f)))
92
+
{
93
+
AddCustomAnimation(FTExtrasCustomMode.Follow);
94
+
GUIUtility.ExitGUI();
95
+
}
96
+
if(GUILayout.Button(newGUIContent("+ Play When…",TriggerChoiceHint),GUILayout.Height(24f)))
97
+
{
98
+
AddCustomAnimation(FTExtrasCustomMode.Trigger);
99
+
GUIUtility.ExitGUI();
100
+
}
101
+
}
84
102
}
85
103
86
-
privatevoidDrawCustomActions()
104
+
privateconststringFollowChoiceHint="The parameter's value drives the animation, e.g. a blush that fades in with cheek puff.";
105
+
privateconststringTriggerChoiceHint="Plays when conditions are met, e.g. an eye shine when both brows stay up for a second.";
106
+
107
+
privateGUIStylechoiceCardStyle;
108
+
109
+
/// <summary>
110
+
/// Empty state: the two kinds of custom animation as large cards, so the first step is in the content
111
+
/// rather than at the bottom of a tall window.
112
+
/// </summary>
113
+
privatevoidDrawAddChoices()
87
114
{
88
-
PawlygonEditorUI.BeginActionBar();
89
-
if(PawlygonEditorUI.DrawSecondaryButton("+ Follow a Parameter"))
115
+
if(choiceCardStyle==null)
90
116
{
91
-
AddCustomAnimation(FTExtrasCustomMode.Follow);
92
-
GUIUtility.ExitGUI();
117
+
choiceCardStyle=newGUIStyle(GUI.skin.button)
118
+
{
119
+
richText=true,
120
+
wordWrap=true,
121
+
alignment=TextAnchor.UpperLeft,
122
+
padding=newRectOffset(10,10,8,8),
123
+
};
93
124
}
94
-
if(PawlygonEditorUI.DrawSecondaryButton("+ Play When…"))
125
+
126
+
using(newEditorGUILayout.HorizontalScope())
95
127
{
96
-
AddCustomAnimation(FTExtrasCustomMode.Trigger);
97
-
GUIUtility.ExitGUI();
128
+
if(GUILayout.Button($"<b>+ Follow a Parameter</b>\n<size=11>{FollowChoiceHint}</size>",choiceCardStyle,GUILayout.MinHeight(58f),GUILayout.ExpandWidth(true)))
129
+
{
130
+
AddCustomAnimation(FTExtrasCustomMode.Follow);
131
+
GUIUtility.ExitGUI();
132
+
}
133
+
GUILayout.Space(6f);
134
+
if(GUILayout.Button($"<b>+ Play When…</b>\n<size=11>{TriggerChoiceHint}</size>",choiceCardStyle,GUILayout.MinHeight(58f),GUILayout.ExpandWidth(true)))
0 commit comments