Skip to content

Instantly share code, notes, and snippets.

@aras-p
Created June 21, 2013 07:38
Show Gist options
  • Select an option

  • Save aras-p/5829553 to your computer and use it in GitHub Desktop.

Select an option

Save aras-p/5829553 to your computer and use it in GitHub Desktop.
C# vs US enum to float cast
// works in C#
Shader.SetGlobalFloat("_SrcBlendGlobal", (float)UnityEngine.Rendering.BlendMode.SrcAlpha);
// no worky in US
Shader.SetGlobalFloat("_SrcBlendGlobal", UnityEngine.Rendering.BlendMode.One cast float);
// BCE0022: Cannot convert 'UnityEngine.Rendering.BlendMode' to 'float'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment