UnityEditor.ShaderInspectorPlatformsPopup.InitializeShaderPlatforms C# (CSharp) Method

InitializeShaderPlatforms() private static method

private static InitializeShaderPlatforms ( ) : void
return void
        private static void InitializeShaderPlatforms()
        {
            if (s_ShaderPlatformNames == null)
            {
                int availableShaderCompilerPlatforms = ShaderUtil.GetAvailableShaderCompilerPlatforms();
                List<string> list = new List<string>();
                List<int> list2 = new List<int>();
                for (int i = 0; i < 0x20; i++)
                {
                    if ((availableShaderCompilerPlatforms & (((int) 1) << i)) != 0)
                    {
                        list.Add(((ShaderUtil.ShaderCompilerPlatformType) i).ToString());
                        list2.Add(i);
                    }
                }
                s_ShaderPlatformNames = list.ToArray();
                s_ShaderPlatformIndices = list2.ToArray();
            }
        }

Usage Example

示例#1
0
 public ShaderInspectorPlatformsPopup(Shader shader)
 {
     this.m_Shader = shader;
     ShaderInspectorPlatformsPopup.InitializeShaderPlatforms();
 }