|
The main material's texture.
The same as using GetTexture or SetTexture with "_MainTex" name.
See Also: SetTexture, GetTexture.
// Assign the texture exposed in the inspector the renderer's material
var texture : Texture;
renderer.material.mainTexture = texture;
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public Texture texture;
void Example() {
renderer.material.mainTexture = texture;
}
}
import UnityEngine
import System.Collections
class example(MonoBehaviour):
public texture as Texture
def Example():
renderer.material.mainTexture = texture