Skip to content

Commit

Permalink
color filters in customizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaimi committed Dec 7, 2020
1 parent e82bff3 commit 783c1db
Show file tree
Hide file tree
Showing 2 changed files with 15,677 additions and 4,009 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ public class UMAPreset
public static bool showWardrobe = false;
public static bool showEditorCustomization = false;
public static bool showPrefinedDNA = false;


public static int currentcolorfilter=0;
public string[] colorfilters = { "Base", "All", "Hide ColorDNA" };
public List<string> baseColorNames = new List<string>();
public int currentDNA = 0;
private string cachedRace = "";
private string[] cachedRaceDNA = { };
Expand All @@ -36,6 +39,8 @@ public class UMAPreset

public void OnEnable()
{
baseColorNames.Clear();
baseColorNames.AddRange(new string[] { "skin","hair","eyes"});
thisDCA = target as DynamicCharacterAvatar;
if (thisDCA.context == null)
{
Expand Down Expand Up @@ -265,13 +270,18 @@ public override void OnInspectorGUI()
EditorGUI.BeginChangeCheck();
if (newCharacterColors.isExpanded)
{
currentcolorfilter = EditorGUILayout.Popup("Filter Colors", currentcolorfilter, colorfilters);

n_newArraySize = EditorGUILayout.DelayedIntField(new GUIContent("Size"), n_origArraySize);
EditorGUILayout.Space();
EditorGUI.indentLevel++;
if (n_origArraySize > 0)
{
for (int i = 0; i < n_origArraySize; i++)
{
SerializedProperty currentColor = newCharacterColors.GetArrayElementAtIndex(i);
if (currentcolorfilter == 0 && !baseColorNames.Contains(currentColor.displayName.ToLower())) continue;
if (currentcolorfilter == 2 && currentColor.displayName.ToLower().Contains("colordna")) continue;
EditorGUILayout.PropertyField(newCharacterColors.GetArrayElementAtIndex(i));
}
}
Expand Down
Loading

0 comments on commit 783c1db

Please sign in to comment.