Skip to content

Commit

Permalink
Update SnailMarker3AnimationCreatorEditor.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
chibiskuld authored Feb 3, 2021
1 parent c3a715d commit 3f8c246
Showing 1 changed file with 34 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,15 @@ private void ShowMenuFoldout(VRCExpressionsMenu menu, string title)
EditorGUILayout.BeginVertical();
GUILayout.BeginHorizontal();
GUILayout.Space(EditorGUI.indentLevel * 17);
if (menu.controls.Count < 8)
Debug.Log(expressionParams.parameters.Length+":"+ menu.controls.Count);

int size = 0;
for (int i = 0; i < expressionParams.parameters.Length; i++)
{
size += VRCExpressionParameters.TypeCost(expressionParams.parameters[i].valueType);
}

if ( menu.controls.Count < expressionParams.parameters.Length )
{
if (GUILayout.Button("Add Marker Here", GUILayout.Width(130)))
{
Expand All @@ -97,7 +105,27 @@ private void ShowMenuFoldout(VRCExpressionsMenu menu, string title)
}
else
{
GUILayout.Label("No room.", GUILayout.Width(130));
if (size < VRCExpressionParameters.MAX_PARAMETER_COST)
{
if (GUILayout.Button("enlarge parameters", GUILayout.Width(130)))
{
if (size < VRCExpressionParameters.MAX_PARAMETER_COST)
{
VRCExpressionParameters.Parameter[] newParams = new VRCExpressionParameters.Parameter[expressionParams.parameters.Length + 1];
for (int i = 0; i < expressionParams.parameters.Length; i++)
{
newParams[i] = expressionParams.parameters[i];
}

expressionParams.parameters = newParams;
EditorUtility.SetDirty(expressionParams);
}
}
}
else
{
GUILayout.Label("No room.", GUILayout.Width(130));
}
}
GUILayout.EndHorizontal();

Expand Down Expand Up @@ -256,19 +284,19 @@ private void ensureDefaults()

private string generatedAssetPath(string name)
{
return Path.Combine("Assets","Snail","Marker3.0","Generated", avatarTransform.name, name);
return Path.Combine("Assets\\Snail\\Marker3.0\\Generated", avatarTransform.name, name);
}
private string generatedFilePath(string name)
{
return Path.Combine(generatedFolderPath(), name);
}
private string generatedFolderPath()
{
return Path.Combine(Application.dataPath, "Snail","Marker3.0","Generated", avatarDescriptor.name);
return Path.Combine(Application.dataPath, "Snail\\Marker3.0\\Generated\\", avatarDescriptor.name);
}
private string templateAssetPath(string name)
{
return Path.Combine("Assets","Snail","Marker3.0","Templates", name);
return Path.Combine("Assets\\Snail\\Marker3.0\\Templates", name);
}
private string generatedGestureName()
{
Expand Down Expand Up @@ -319,7 +347,7 @@ private void Cleanup()
/*******************************
* Animations
*******************************/
private void ConfigureAnimationController()
private void ConfigureAnimationController()
{
//Check and build the animation controller:
CreateParameters();
Expand Down

0 comments on commit 3f8c246

Please sign in to comment.