本文整理汇总了C#中UnityEditor.MaterialEditor.PropertiesChanged方法的典型用法代码示例。如果您正苦于以下问题:C# MaterialEditor.PropertiesChanged方法的具体用法?C# MaterialEditor.PropertiesChanged怎么用?C# MaterialEditor.PropertiesChanged使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEditor.MaterialEditor
的用法示例。
在下文中一共展示了MaterialEditor.PropertiesChanged方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGUI
//.........这里部分代码省略.........
}
//Shader Flags
GUILayout.Label("Features", EditorStyles.boldLabel);
string features = "";
if(mShaderFeatures != null)
{
foreach(string flag in mShaderFeatures)
{
features += flag + ", ";
}
}
if(features.Length > 0)
features = features.Substring(0, features.Length-2);
GUILayout.Label(features, EditorStyles.wordWrappedMiniLabel);
//Shader Keywords
GUILayout.Label("Keywords", EditorStyles.boldLabel);
string keywords = "";
foreach(string keyword in keywordsList)
{
keywords += keyword + ", ";
}
if(keywords.Length > 0)
keywords = keywords.Substring(0, keywords.Length-2);
GUILayout.Label(keywords, EditorStyles.wordWrappedMiniLabel);
#endif
//--------------------------------------------------------------------------------------
if(EditorGUI.EndChangeCheck())
{
materialEditor.PropertiesChanged();
}
}
//Update Keywords
if(updateKeywords)
{
if(materialEditor.targets != null && materialEditor.targets.Length > 0)
{
foreach(Object t in materialEditor.targets)
{
(t as Material).shaderKeywords = keywordsList.ToArray();
EditorUtility.SetDirty(t);
}
}
else
{
targetMaterial.shaderKeywords = keywordsList.ToArray();
EditorUtility.SetDirty(targetMaterial);
}
}
//Update Variant
if(updateVariant && !isGeneratedShader)
{
string baseName = isMobileShader ? BASE_SHADER_NAME_MOB : BASE_SHADER_NAME;
string newShader = baseName;
for(int i = 0; i < ShaderVariants.Count; i++)
{
if(ShaderVariantsEnabled[i])
{
newShader += " " + ShaderVariants[i];