設定された名前からfloat値を取得します
See Also: SetFloat, Materials, ShaderLab documentation, Shader.PropertyToID.
function Start() { renderer.material.shader = Shader.Find("Specular"); print(renderer.material.GetFloat("_Shininess")); }
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Start() { renderer.material.shader = Shader.Find("Specular"); print(renderer.material.GetFloat("_Shininess")); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def Start() as void: renderer.material.shader = Shader.Find('Specular') print(renderer.material.GetFloat('_Shininess'))