Using Unityeditor;public class Poolmanagereditor { [MenuItem ("Manager/creat gameobjectpoolconfig")] static void Creatgameobjectpoollist () { Gameobjectpoollist poollist = scriptableobject.createinstance< Gameobjectpoollist> ();//Generate editable object string path [email protected] "assets/framework/resources/ Gameobjectpool.asset ";///Saved path assetdatabase.createasset (Poollist,path);//First step assetdatabase.saveassets ( );//Second Step }}
Gameobjectpool class
Using system.collections;using system.collections.generic;using unityengine;using System; [Serializable]public class Gameobjectpool { [private field of serializefield]//class, and private string name can be listed on the Unity editor ; [Serializefield] Private Gameobject prefab; [Serializefield] private int maxamount; [NonSerialized] Private list<gameobject> golist = new list<gameobject> ();}
Gameobjectpoollist class
Using system.collections;using system.collections.generic;using unityengine;using System; [Serializable]public class Gameobjectpoollist:scriptableobject {public list<gameobjectpool> poolList;}
Unity Editor generates configurable edit files