function CopyPropertiesFromMaterial (mat : Material) : void
Description
Copy properties from other material into this material.
var mat : Material;
if (!mat) {
Debug.LogError(
"Assign a material on the inspector.");
return;
}
renderer.material.CopyPropertiesFromMaterial(mat);
using UnityEngine;
using System.Collections;
public class example :
MonoBehaviour {
public Material mat;
void Awake() {
if (!mat) {
Debug.LogError(
"Assign a material on the inspector.");
return;
}
renderer.material.CopyPropertiesFromMaterial(mat);
}
}
import UnityEngine
import System.Collections
class example(
MonoBehaviour):
public mat as Material
def
Awake():
if not mat:
Debug.LogError('Assign a material on the inspector.')
return renderer.material.CopyPropertiesFromMaterial(mat)