Copy properties from other material into this material.
// Attach this to a gameObject that has a renderer. // Copies any property mat has and assigns it to this transform material
var mat : Material;
function Start() { GetComponent.<Renderer>().material.CopyPropertiesFromMaterial(mat); }
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { public Material mat; void Start() { GetComponent<Renderer>().material.CopyPropertiesFromMaterial(mat); } }