Version: 5.4
public float GetFloat (string propertyName);
public float GetFloat (int nameID);

Parameters

propertyName The name of the property.
nameID The name ID of the property retrieved by Shader.PropertyToID.

Description

Получает именованное float значение.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Start() { Renderer rend = GetComponent<Renderer>(); rend.material.shader = Shader.Find("Specular"); print(rend.material.GetFloat("_Shininess")); } }