Zhonghui

每个不曾起舞的日子,都是对生命的辜负

User Tools

Site Tools


软件:unity:editor中可以自定义的位置

Editor中可以自定义的位置


#if UNITY_EDITOR
 
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
 
public class Custom : MonoBehaviour
{
    [MenuItem("Custom/Custom Menu")]
    public static void CustomMenu()
    {
 
    }
 
    [MenuItem("GameObject/Custom/Custom GameObject Action")]
    public static void CustomGameObjectAction()
    {
        // Get Selected GameObject
    }
 
    [MenuItem("Assets/Custom/Custom Assets Action")]
    public static void CustomAssetsAction()
    {
        // Get Selected Asset
    }
 
    [ContextMenu("Custom Context Menu")]
    public void CustomContextMenu()
    {
 
    }
}
 
[CustomEditor(typeof(Custom))]
public class CustomInspector : Editor
{
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        GUILayout.Label("Custom Inspector");
    }
}
 
[CreateAssetMenu(fileName = "CustomAsset", menuName = "Custom/Custom Asset")]
public class CustomAsset : ScriptableObject
{
 
}
 
#endif
/var/www/DokuWikiStick/dokuwiki/data/pages/软件/unity/editor中可以自定义的位置.txt · Last modified: 2023/04/03 06:55 by zh