- Odin Inspector 系列教程 --- Custom C
- Odin Inspector 系列教程 --- Custom V
- Odin Inspector 系列教程 --- 自定义Odin序
- Odin Inspector 系列教程 --- Odin Sta
- Odin Inspector 系列教程 --- RoadMap(
- Odin Inspector 系列教程 --- Foldout
- Odin Inspector 系列教程 --- Vertical
- Odin Inspector 系列教程 --- Responsi
- Odin Inspector 系列教程 --- Preview
- Odin Inspector 系列教程 --- Horizont
Custom Context Menu Attribute:可用于任何属性,并将自定义选项添加到属性的上下文菜单。当您要将自定义操作添加到属性的上下文菜单时,请使用此选项。

using Sirenix.OdinInspector;
using UnityEngine;
public class CustomContextMenuAttributeExample : MonoBehaviour
{
[InfoBox("右键属性可在菜单中出发指定的函数.")]
[CustomContextMenu("Say Hello/菜鸟海澜", "SayHelloFunction")]
public int MyProperty;
private void SayHelloFunction()
{
Debug.Log("Hello 菜鸟海澜");
}
}
网友评论