UnityEngine.Material.GetTexture C# (CSharp) Method

GetTexture() private method

private GetTexture ( int nameID ) : Texture
nameID int
return Texture
        public extern Texture GetTexture(int nameID);
        /// <summary>

Same methods

Material::GetTexture ( string propertyName ) : Texture

Usage Example

        } //GetBones

        private static void GetMeshes(Transform transform, List<SkinnedMeshRenderer> meshes, List<UnityEngine.Material> materials, List<UnityEngine.Texture> textures)
        {
            foreach (Transform t in transform)
            {
                if (t.GetComponent<SkinnedMeshRenderer>())
                {
                    SkinnedMeshRenderer mesh = t.gameObject.GetComponent<SkinnedMeshRenderer>();

                    meshes.Add(t.gameObject.GetComponent<SkinnedMeshRenderer>());

                    UnityEngine.Material material = mesh.sharedMaterial;

                    if (!materials.Contains(material))
                    {
                        materials.Add(material);

                        if (material.HasProperty("_Base_Tex_SRGB"))
                        {
                            UnityEngine.Texture texture = material.GetTexture("_Base_Tex_SRGB");

                            if (texture != null)
                            {
                                if (!textures.Contains(texture))
                                {
                                    textures.Add(material.GetTexture("_Base_Tex_SRGB"));
                                } //if
                            } //if
                        } //if
                    } //if
                } //if
            } //foreach
        } //GetMeshes
All Usage Examples Of UnityEngine.Material::GetTexture