几个常用的属性
2015-12-17 本文已影响42人
Babybus_Unity
using UnityEngine;
using System.Collections;
public class Test : MonoBehaviour
{
[Header("Hi there!")]
public string TheHeader = "Header!";
[Tooltip("This is THE VALUE!")]
[ContextMenuItem("Reset", "resetTheValue")]
public float TheValue = 42.0f;
[Space(50)]
public string TheString = "THE STRING";
[Range(0f, 10f)]
public float value;
private void resetTheValue()
{
TheValue = 42;
}
}