本文整理汇总了C#中UnityEngine.Shader.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Shader.ToString方法的具体用法?C# Shader.ToString怎么用?C# Shader.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Shader
的用法示例。
在下文中一共展示了Shader.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckShaderAndCreateMaterial
protected Material CheckShaderAndCreateMaterial(Shader s, Material m2Create)
{
if (!s)
{
Debug.Log("Missing shader in " + this.ToString());
enabled = false;
return null;
}
if (s.isSupported && m2Create && m2Create.shader == s)
return m2Create;
if (!s.isSupported)
{
enabled = false;
isSupported = false;
Debug.Log("The shader " + s.ToString() + " on effect " + this.ToString() + " is not supported on this platform!");
return null;
}
else
{
//Debug.Log("Creating material");
m2Create = new Material(s);
m2Create.hideFlags = HideFlags.DontSave;
if (m2Create)
{
return m2Create;
}
else
return null;
}
}
示例2: CheckShaderAndCreateMaterial
static Material CheckShaderAndCreateMaterial(Shader s , Material m2Create )
{
if (m2Create && m2Create.shader == s)
return m2Create;
if (!s)
{
Debug.LogWarning("PostEffects: missing shader for " + m2Create.ToString ());
return null;
}
if(!s.isSupported)
{
Debug.LogWarning ("The shader " + s.ToString () + " is not supported");
return null;
}
else
{
m2Create = new Material (s);
m2Create.hideFlags = HideFlags.DontSave;
return m2Create;
}
}
示例3: CheckShader
// deprecated but needed for old effects to survive upgrading
bool CheckShader ( Shader s) {
Debug.Log("The shader " + s.ToString () + " on effect "+ ToString () + " is not part of the Unity 3.2+ effects suite anymore. For best performance and quality, please ensure you are using the latest Standard Assets Image Effects (Pro only) package.");
if (!s.isSupported) {
NotSupported ();
return false;
}
else {
return false;
}
}