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

スクリプト言語

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

Material.SetTextureScale

public function SetTextureScale(propertyName: string, scale: Vector2): void;

Description

テクスチャのスケールを設定します

Unityのビルトインシェーダーでは、テクスチャを設定するプロパティ名は3 つあります:
"_MainTex" メインのディフューズテクスチャ。 ::ref:: mainTextureScale でも設定できます。
"_BumpMap" ノーマルマップ
"_Cube" リフレクションキューブマップ See Also: mainTextureScale property, GetTextureScale.

	function Update () {
		// Animates main texture scale in a funky way!
		var scaleX : float = Mathf.Cos (Time.time) * 0.5 + 1;
		var scaleY : float = Mathf.Sin (Time.time) * 0.5 + 1;
		renderer.material.SetTextureScale ("_MainTex", Vector2(scaleX,scaleY));
	}