言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Material.CopyPropertiesFromMaterial

public function CopyPropertiesFromMaterial(mat: Material): void;

Description

マテリアルのプロパティを他のマテリアルにコピーします

	// Attach this to a gameObject that has a renderer.
	// Copies any property mat has and assigns it to this transform material

	var mat : Material;

	if (!mat) {
		Debug.LogError("Assign a material on the inspector.");
		return;
	}

	renderer.material.CopyPropertiesFromMaterial(mat);