几个常用的属性

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;

    }

}

你可能感兴趣的:(几个常用的属性)