Skip to content

Commit

Permalink
feat: asset upgrade system 'SOFTMASKABLE' shader feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Nov 23, 2024
1 parent eec3212 commit d36f932
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ public bool ModifyText(StringBuilder sb, string text)
var space = Regex.Match(text, @"^\s*").Value;
sb.AppendLine(text);
sb.Append(space).AppendLine("#pragma shader_feature_local _ SOFTMASK_EDITOR // Add for soft mask");
sb.Append(space).AppendLine("#pragma shader_feature_local _ SOFTMASKABLE // Add for soft mask");
return true;
}

// Remove the following line:
// #pragma shader_feature_local _ SOFTMASK_EDITOR // Add for soft mask
if (Regex.IsMatch(text, @"#pragma.*\s*(SOFTMASK_EDITOR)"))
// #pragma shader_feature_local _ SOFTMASKABLE // Add for soft mask
if (Regex.IsMatch(text, @"#pragma.*\s*(SOFTMASK_EDITOR|SOFTMASKABLE)"))
{
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions Packages/src/Editor/UISoftMaskProjectSettingsEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public override void OnInspectorGUI()
_shaderVariantRegistryEditor.Draw();
serializedObject.ApplyModifiedProperties();

// Upgrade v1 to v2.
// Upgrade All Assets For V3.
EditorGUILayout.Space();
EditorGUILayout.LabelField("Upgrade", EditorStyles.boldLabel);
if (GUILayout.Button("Upgrade All Assets V1 to V2"))
if (GUILayout.Button("Upgrade All Assets For V3"))
{
EditorApplication.delayCall += () => new UISoftMaskModifierRunner().RunIfUserWantsTo();
}
Expand Down

0 comments on commit d36f932

Please sign in to comment.