当前位置: 首页>>代码示例>>C#>>正文


C# Shader.ToString方法代码示例

本文整理汇总了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;
            }
        }
开发者ID:Waffletech,项目名称:KerbalKwality,代码行数:32,代码来源:ImageEffectBase.cs

示例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;
            }
        }
开发者ID:haejoon,项目名称:realdedicated-unitylibrary,代码行数:23,代码来源:PostEffects.cs

示例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;
     }
 }
开发者ID:jannainm,项目名称:WORLD_WAR_Z,代码行数:11,代码来源:PostEffectsBase.cs


注:本文中的UnityEngine.Shader.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。