This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class Question4_practical : ScriptableObject | |
{ | |
public string name; | |
public int hp; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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