當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。