友情链接


真我闪博
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.

posted on 2013-10-16 11:43  xbg  阅读(985)  评论(0编辑  收藏  举报