Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
using UnityEngine;
public class Question4_practical : ScriptableObject
{
public string name;
public int hp;
}
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(Question4_practical))]
public class Question4Editor_practical : Editor
{
[MenuItem("Assets/CreateAsset")]
static void Create()
{
Question4_practical question4Practical = CreateInstance<Question4_practical>();
AssetDatabase.CreateAsset(question4Practical, "Assets/Question4_practical/Question4_practical.asset");
AssetDatabase.SaveAssets();
}
public override Texture2D RenderStaticPreview(string assetPath, Object[] subAssets, int width, int height)
{
return (Texture2D)AssetDatabase.LoadAssetAtPath("Assets/Question4_practical/logo.png", typeof(Texture2D));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment