UnityEditor.ShaderImporter.GetDefaultTexture C# (CSharp) Method

GetDefaultTexture() private method

private GetDefaultTexture ( string name ) : Texture
name string
return UnityEngine.Texture
        public extern Texture GetDefaultTexture(string name);
        [MethodImpl(MethodImplOptions.InternalCall)]

Usage Example

コード例 #1
0
        internal override void ResetValues()
        {
            base.ResetValues();
            this.propertyNames = new List <string>();
            this.displayNames  = new List <string>();
            this.textures      = new List <Texture>();
            this.dimensions    = new List <TextureDimension>();
            ShaderImporter shaderImporter = this.target as ShaderImporter;

            if (shaderImporter == null)
            {
                return;
            }
            Shader shader = shaderImporter.GetShader();

            if (shader == null)
            {
                return;
            }
            int propertyCount = ShaderUtil.GetPropertyCount(shader);

            for (int i = 0; i < propertyCount; i++)
            {
                if (ShaderUtil.GetPropertyType(shader, i) == ShaderUtil.ShaderPropertyType.TexEnv)
                {
                    string  propertyName        = ShaderUtil.GetPropertyName(shader, i);
                    string  propertyDescription = ShaderUtil.GetPropertyDescription(shader, i);
                    Texture defaultTexture      = shaderImporter.GetDefaultTexture(propertyName);
                    this.propertyNames.Add(propertyName);
                    this.displayNames.Add(propertyDescription);
                    this.textures.Add(defaultTexture);
                    this.dimensions.Add(ShaderUtil.GetTexDim(shader, i));
                }
            }
        }
All Usage Examples Of UnityEditor.ShaderImporter::GetDefaultTexture