using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class Test : MonoBehaviour
{
[ContextMenu("MyItem")]
void MyTestA()
{
Debug.Log(1);
}
}
使用ContextMenu时,下面函数是非静态的.
此脚本继承MonoBehaviour.
此脚本不能放在Editor文件夹中.
此脚本需拖到物体上.