本文整理汇总了C#中UnityEngine.Shader.GetInstanceID方法的典型用法代码示例。如果您正苦于以下问题:C# Shader.GetInstanceID方法的具体用法?C# Shader.GetInstanceID怎么用?C# Shader.GetInstanceID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Shader
的用法示例。
在下文中一共展示了Shader.GetInstanceID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPropertyString
private static string GetPropertyString(Shader shader, string name)
{
if (shader == null)
{
return string.Empty;
}
return (shader.GetInstanceID() + "_" + name);
}
示例2: InvalidatePropertyCache
internal static void InvalidatePropertyCache(Shader shader)
{
if (shader == null)
{
return;
}
string value = shader.GetInstanceID() + "_";
List<string> list = new List<string>();
foreach (string current in MaterialPropertyHandler.s_PropertyHandlers.Keys)
{
if (current.StartsWith(value))
{
list.Add(current);
}
}
foreach (string current2 in list)
{
MaterialPropertyHandler.s_PropertyHandlers.Remove(current2);
}
}
示例3: InvalidatePropertyCache
internal static void InvalidatePropertyCache(Shader shader)
{
if ((UnityEngine.Object) shader == (UnityEngine.Object) null)
return;
string str = shader.GetInstanceID().ToString() + "_";
List<string> stringList = new List<string>();
using (Dictionary<string, MaterialPropertyHandler>.KeyCollection.Enumerator enumerator = MaterialPropertyHandler.s_PropertyHandlers.Keys.GetEnumerator())
{
while (enumerator.MoveNext())
{
string current = enumerator.Current;
if (current.StartsWith(str))
stringList.Add(current);
}
}
using (List<string>.Enumerator enumerator = stringList.GetEnumerator())
{
while (enumerator.MoveNext())
{
string current = enumerator.Current;
MaterialPropertyHandler.s_PropertyHandlers.Remove(current);
}
}
}
示例4: GetPropertyString
private static string GetPropertyString(Shader shader, string name)
{
if ((UnityEngine.Object) shader == (UnityEngine.Object) null)
return string.Empty;
return shader.GetInstanceID().ToString() + "_" + name;
}
示例5: InvalidatePropertyCache
internal static void InvalidatePropertyCache(Shader shader)
{
if (shader != null)
{
string str = shader.GetInstanceID() + "_";
List<string> list = new List<string>();
foreach (string str2 in s_PropertyHandlers.Keys)
{
if (str2.StartsWith(str))
{
list.Add(str2);
}
}
foreach (string str3 in list)
{
s_PropertyHandlers.Remove(str3);
}
}
}