SHARE
TWEET

Untitled

a guest Dec 10th, 2018 14 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  switch (blendMode)
  2.         {
  3.             case BlendMode.Opaque:
  4.                 material.SetOverrideTag("RenderType", "");
  5.                 material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
  6.                 material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
  7.                 material.SetInt("_ZWrite", 1);
  8.                 material.DisableKeyword("_ALPHATEST_ON");
  9.                 material.DisableKeyword("_ALPHABLEND_ON");
  10.                 material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
  11.                 material.renderQueue = -1;
  12.                 break;
  13.             case BlendMode.Cutout:
  14.                 material.SetOverrideTag("RenderType", "TransparentCutout");
  15.                 material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
  16.                 material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
  17.                 material.SetInt("_ZWrite", 1);
  18.                 material.EnableKeyword("_ALPHATEST_ON");
  19.                 material.DisableKeyword("_ALPHABLEND_ON");
  20.                 material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
  21.                 material.renderQueue = 2451;
  22.                 break;
  23.             case BlendMode.Fade:
  24.                 material.SetOverrideTag("RenderType", "Transparent");
  25.                 material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
  26.                 material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
  27.                 material.SetInt("_ZWrite", 0);
  28.                 material.DisableKeyword("_ALPHATEST_ON");
  29.                 material.EnableKeyword("_ALPHABLEND_ON");
  30.                 material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
  31.                 material.renderQueue = 3000;
  32.                 break;
  33.             case BlendMode.Transparent:
  34.                 material.SetOverrideTag("RenderType", "Transparent");
  35.                 material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
  36.                 material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
  37.                 material.SetInt("_ZWrite", 0);
  38.                 material.DisableKeyword("_ALPHATEST_ON");
  39.                 material.DisableKeyword("_ALPHABLEND_ON");
  40.                 material.EnableKeyword("_ALPHAPREMULTIPLY_ON");
  41.                 material.renderQueue = 3000;
  42.                 break;
  43.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top