Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit 97af02b

Browse files
committed
新增示例
1 parent 7f1dba0 commit 97af02b

11 files changed

+241
-277
lines changed

Assets/EmojiText/Editor/EmojiShaderGUI.cs

+14-14
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ public class EmojiShaderGUI : ShaderGUI
1111

1212
public override void OnGUI(UnityEditor.MaterialEditor materialEditor, UnityEditor.MaterialProperty[] properties)
1313
{
14-
// base.OnGUI(materialEditor, properties);
14+
//// base.OnGUI(materialEditor, properties);
1515

16-
Material targetMat = materialEditor.target as Material;
16+
//Material targetMat = materialEditor.target as Material;
1717

18-
// see if redify is set, and show a checkbox
19-
bool redify = Array.IndexOf(targetMat.shaderKeywords, "EMOJI_ANIMATION") != -1;
20-
EditorGUI.BeginChangeCheck();
21-
redify = EditorGUILayout.Toggle("Emoji Animation", redify);
22-
if (EditorGUI.EndChangeCheck())
23-
{
24-
// enable or disable the keyword based on checkbox
25-
if (redify)
26-
targetMat.EnableKeyword("EMOJI_ANIMATION");
27-
else
28-
targetMat.DisableKeyword("EMOJI_ANIMATION");
29-
}
18+
//// see if redify is set, and show a checkbox
19+
//bool redify = Array.IndexOf(targetMat.shaderKeywords, "EMOJI_ANIMATION") != -1;
20+
//EditorGUI.BeginChangeCheck();
21+
//redify = EditorGUILayout.Toggle("Emoji Animation", redify);
22+
//if (EditorGUI.EndChangeCheck())
23+
//{
24+
// // enable or disable the keyword based on checkbox
25+
// if (redify)
26+
// targetMat.EnableKeyword("EMOJI_ANIMATION");
27+
// else
28+
// targetMat.DisableKeyword("EMOJI_ANIMATION");
29+
//}
3030
}
3131
}
3232

0 commit comments

Comments
 (0)