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


C# Material.DisableKeyword方法代码示例

本文整理汇总了C#中UnityEngine.Material.DisableKeyword方法的典型用法代码示例。如果您正苦于以下问题:C# Material.DisableKeyword方法的具体用法?C# Material.DisableKeyword怎么用?C# Material.DisableKeyword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.Material的用法示例。


在下文中一共展示了Material.DisableKeyword方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

    IEnumerator Start()
    {
        foreach (var r in GetComponentsInChildren<Renderer>()) {
            renderers.Add(r);
            originalMaterials[r] = r.sharedMaterial;

            var material = new Material(r.material);
            material.SetFloat("_Mode", 2);
            material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
            material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
            material.SetInt("_ZWrite", 0);
            material.DisableKeyword("_ALPHATEST_ON");
            material.EnableKeyword("_ALPHABLEND_ON");
            material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
            material.renderQueue = 3000;
            r.material = material;
        }

        for (float t = 0; t < 1f; t += Time.deltaTime) {
            if (!UpdateRenderers(t)) {
                yield break;
            }

            yield return null;
        }

        foreach (var r in renderers) {
            if (r) {
                r.material = originalMaterials[r];
            }
        }

        Destroy(this);
    }
开发者ID:rcd229,项目名称:Crystallize2D,代码行数:34,代码来源:MaterialFadeIn.cs

示例2: SetColorRange

    private void SetColorRange(Material material)
    {
        switch (ColorRange)
        {
            case TOD_ColorRangeType.Auto:
                if (Components.Camera && Components.Camera.HDR)
                {
                    material.EnableKeyword("HDR");
                    material.DisableKeyword("LDR");
                }
                else
                {
                    material.DisableKeyword("HDR");
                    material.EnableKeyword("LDR");
                }
                break;

            case TOD_ColorRangeType.HDR:
                material.EnableKeyword("HDR");
                material.DisableKeyword("LDR");
                break;

            case TOD_ColorRangeType.LDR:
                material.DisableKeyword("HDR");
                material.EnableKeyword("LDR");
                break;
        }
    }
开发者ID:Drenerdo,项目名称:projectspark,代码行数:28,代码来源:TOD_Sky+Settings.cs

示例3: SetColorSpace

    private void SetColorSpace(Material material)
    {
        switch (ColorSpace)
        {
            case TOD_ColorSpaceType.Auto:
                if (QualitySettings.activeColorSpace == UnityEngine.ColorSpace.Linear)
                {
                    material.EnableKeyword("LINEAR");
                    material.DisableKeyword("GAMMA");
                }
                else
                {
                    material.DisableKeyword("LINEAR");
                    material.EnableKeyword("GAMMA");
                }
                break;

            case TOD_ColorSpaceType.Linear:
                material.EnableKeyword("LINEAR");
                material.DisableKeyword("GAMMA");
                break;

            case TOD_ColorSpaceType.Gamma:
                material.DisableKeyword("LINEAR");
                material.EnableKeyword("GAMMA");
                break;
        }
    }
开发者ID:Drenerdo,项目名称:projectspark,代码行数:28,代码来源:TOD_Sky+Settings.cs

示例4: SetupMaterialWithBlendMode

 public static void SetupMaterialWithBlendMode(Material material, BlendMode blendMode)
 {
     switch (blendMode)
     {
     case BlendMode.Opaque:
         material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
         material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
         material.SetInt("_ZWrite", 1);
         material.DisableKeyword("_ALPHATEST_ON");
         material.DisableKeyword("_ALPHABLEND_ON");
         material.renderQueue = -1;
         break;
     case BlendMode.Cutout:
         material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
         material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
         material.SetInt("_ZWrite", 1);
         material.EnableKeyword("_ALPHATEST_ON");
         material.DisableKeyword("_ALPHABLEND_ON");
         material.renderQueue = 2450;
         break;
     case BlendMode.Transparent:
         material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
         material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
         material.SetInt("_ZWrite", 0);
         material.DisableKeyword("_ALPHATEST_ON");
         material.EnableKeyword("_ALPHABLEND_ON");
         material.renderQueue = 3000;
         break;
     }
 }
开发者ID:SilentSupernova,项目名称:Getaway,代码行数:30,代码来源:StandardShaderCurveGUI.cs

示例5: SetTransparent

 public static void SetTransparent(Material material)
 {
     material.SetOverrideTag("RenderType", "Transparent");
     material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
     material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
     material.SetInt("_ZWrite", 0);
     material.DisableKeyword("_ALPHATEST_ON");
     material.DisableKeyword("_ALPHABLEND_ON");
     material.EnableKeyword("_ALPHAPREMULTIPLY_ON");
     material.renderQueue = 3000;
 }
开发者ID:TomorrowTodayLabs,项目名称:VRInteraction,代码行数:11,代码来源:VRIHelpers.cs

示例6: SetOpaque

 public static void SetOpaque(Material material)
 {
     material.SetOverrideTag("RenderType", "");
     material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
     material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
     material.SetInt("_ZWrite", 1);
     material.DisableKeyword("_ALPHATEST_ON");
     material.DisableKeyword("_ALPHABLEND_ON");
     material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
     material.renderQueue = -1;
 }
开发者ID:apekshadarbari,项目名称:PokerFace,代码行数:11,代码来源:NVRHelpers.cs

示例7: Transparent

 void Transparent(Material material)
 {
     material.SetFloat("_Mode", 3);
     material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
     material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
     material.SetInt("_ZWrite", 0);
     material.DisableKeyword("_ALPHATEST_ON");
     material.DisableKeyword("_ALPHABLEND_ON");
     material.EnableKeyword("_ALPHAPREMULTIPLY_ON");
     material.renderQueue = 3000;
 }
开发者ID:jrand35,项目名称:AmazingRPG,代码行数:11,代码来源:Comb.cs

示例8: Opaque

 void Opaque(Material material)
 {
     material.SetFloat("_Mode", 0);
     material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
     material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
     material.SetInt("_ZWrite", 1);
     material.DisableKeyword("_ALPHATEST_ON");
     material.DisableKeyword("_ALPHABLEND_ON");
     material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
     material.renderQueue = -1;
 }
开发者ID:jrand35,项目名称:AmazingRPG,代码行数:11,代码来源:Comb.cs

示例9: setMaterialToFade

 private void setMaterialToFade(Material m)
 {
     m.SetFloat("_Mode", 2);
     m.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
     m.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
     m.SetInt("_ZWrite", 0);
     m.DisableKeyword("_ALPHATEST_ON");
     m.EnableKeyword("_ALPHABLEND_ON");
     m.DisableKeyword("_ALPHAPREMULTIPLY_ON");
     m.renderQueue = 3000;
 }
开发者ID:DarkDecaydence,项目名称:MGAE_4D-Puzzle,代码行数:11,代码来源:ParentFourthDimensional.cs

示例10: Start

 void Start()
 {
     Material m = new Material(Shader.Find("Custom/StandardDepthBuffer"));
     m.SetFloat("_Mode", 2);
     m.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
     m.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
     m.SetInt("_ZWrite", 0);
     m.DisableKeyword("_ALPHATEST_ON");
     m.EnableKeyword("_ALPHABLEND_ON");
     m.DisableKeyword("_ALPHAPREMULTIPLY_ON");
     m.renderQueue = 3000;
 }
开发者ID:youdiaozi,项目名称:PokeVive,代码行数:12,代码来源:Calibration.cs

示例11: ApplyOpaque

 public void ApplyOpaque(Color col)
 {
     rend = this.gameObject.GetComponent<Renderer>().material;
     rend.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
     rend.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
     rend.SetInt("_ZWrite", 1);
     rend.DisableKeyword("_ALPHATEST_ON");
     rend.DisableKeyword("_ALPHABLEND_ON");
     rend.DisableKeyword("_ALPHAPREMULTIPLY_ON");
     rend.renderQueue = -1;
     StartCoroutine(colorLerp1(rend.GetColor("_Color"), col));
 }
开发者ID:RuslanAhmetsharipov,项目名称:TalkingHead,代码行数:12,代码来源:MaterialChanging.cs

示例12: CreateMaterial

 Material CreateMaterial(Color emissionColor)
 {
     Material m = new Material(outlineBufferShader);
     m.SetColor("_Color", emissionColor);
     m.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
     m.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
     m.SetInt("_ZWrite", 0);
     m.DisableKeyword("_ALPHATEST_ON");
     m.EnableKeyword("_ALPHABLEND_ON");
     m.DisableKeyword("_ALPHAPREMULTIPLY_ON");
     m.renderQueue = 3000;
     return m;
 }
开发者ID:Cabriter,项目名称:Outline-Effect,代码行数:13,代码来源:OutlineEffect.cs

示例13: ApplyTransparent

 void ApplyTransparent(Color col)
 {
     rend = this.gameObject.GetComponent<Renderer>().material;
     rend.SetFloat("_Mode", 3f);
     rend.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
     rend.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
     rend.SetInt("_ZWrite", 0);
     rend.DisableKeyword("_ALPHATEST_ON");
     rend.DisableKeyword("_ALPHABLEND_ON");
     rend.EnableKeyword("_ALPHAPREMULTIPLY_ON");
     rend.renderQueue = 3000;
     StartCoroutine(colorLerp1(rend.GetColor("_Color"), col));
 }
开发者ID:RuslanAhmetsharipov,项目名称:TalkingHead,代码行数:13,代码来源:MaterialChanging.cs

示例14: SetOpaque

        public static void SetOpaque(Material material)
        {
            if (material.shader != StandardShader)
                Debug.LogWarning("Trying to set opaque mode on non-standard shader. Please use the Standard Shader instead or modify this method.");

            material.SetOverrideTag("RenderType", "");
            material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
            material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
            material.SetInt("_ZWrite", 1);
            material.DisableKeyword("_ALPHATEST_ON");
            material.DisableKeyword("_ALPHABLEND_ON");
            material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
            material.renderQueue = -1;
        }
开发者ID:Cratesmith,项目名称:NewtonVR,代码行数:14,代码来源:NVRHelpers.cs

示例15: SetKeyword

 static void SetKeyword(Material m, string keyword, bool state)
 {
     if (state)
         m.EnableKeyword(keyword);
     else
         m.DisableKeyword(keyword);
 }
开发者ID:Zero-Ax,项目名称:Mouse-position-Drag,代码行数:7,代码来源:SprayUnlitMaterialEditor.cs


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