Unity_Attribute属性大全

using UnityEngine;
using UnityEngine.Serialization;
using System.Collections;
using System.Runtime.InteropServices;

//[RequireComponent(typeof(Rigidbody))]
//[DisallowMultipleComponent]
//[AddComponentMenu("TestAttribute")]
[ExecuteInEditMode]
public class TestAttribute : MonoBehaviour 
{
    [SerializeField]
    int count;

    [SerializeField, Range(0, 5)]
    int countR;

    [SerializeField, Space(15)]
    int countS;

    [SerializeField, MultilineAttribute(2)]
    string message;

    [SerializeField, TextAreaAttribute(2, 5)]
    string message2;

    [HideInInspector]
    string message3;

    [FormerlySerializedAs("First")]
    int countF;

    [ContextMenu("int")]
    void Print()
    {

    }

    [DllImport("DLLName")]
    private static extern void MethodName();    

	void Start () 
	{
	
	}

	void Update () 
	{
	    Debug.Log("TestAttribute");
	}
}

你可能感兴趣的:(Unity3D)