U_编辑器自定义窗口
https://blog.51cto.com/u_15296378/4969538?b=totalstatistic
https://www.cnblogs.com/xiaoyulong/p/10120565.html
youtube教程:
Behavior Node Editor:
https://www.youtube.com/watch?v=JOgnGG0OQ9w&list=PL1bPKmY0c-wl9zNYuONgYePSAjkML9NRG&index=1
Github:
https://github.com/gaojinjin/Editor-Drawer
重绘制Inspector面板:
https://zhuanlan.zhihu.com/p/34234315
C#
//核心代码
[CustomEditor(typeof(TestItemSO))]
public class TestItemSOEditor : Editor {
private TestItemSO testItemSO;
public override void OnInspectorGUI() {
base.OnInspectorGUI();
testItemSO = (TestItemSO)target;
if (testItemSO.ItemType == ItemType.Equip) {//武器类型
testItemSO.WeaponSO = (TestWeaponSO)EditorGUILayout.ObjectField("武器配置", testItemSO.WeaponSO, typeof(TestWeaponSO));//武器配置 仅在配置为武器的时候显示
}
}
}
public class TestItemSO : ScriptableObject {
public ItemType ItemType;
[HideInInspector] public TestWeaponSO WeaponSO;
}