using UnityEditor;
using UnityEngine;

[CustomEditor(typeof(test))]
public class testEditor : Editor
{
    void OnEnable()
    {
    }

    public override void OnInspectorGUI()
    {
        test myTarget = (test)target;
        myTarget.MyValue = EditorGUILayout.IntSlider(
                "Val-you", myTarget.MyValue, 1, 10);
    }
}

照网上写的代码,报错,后来发现这个文件要放到Assets/Editor目录下
Instance of testEditor couldn't be created. The script class needs to derive from ScriptableObject and be placed in the Assets/Editor folder.

相关文章:

  • 2022-02-07
  • 2022-12-23
  • 2021-06-02
  • 2021-06-04
  • 2021-10-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
相关资源
相似解决方案