, Unity插件 – 脚本对象数据库 ScriptableObject Database,

,

file size: 956.8 KB

version: 1.5

original Unity version: 2017.2.0 or higher

it takes only a few seconds to create a database for ScriptableObjects. For convenience, organize your ScriptableObject data into database files. No coding is required, and you can quickly and easily set up a database for any ScriptableObject type using Database Type Creator. Use a custom inspector and property drawer? No problem, the data displayed uses the Unity built-in inspector and automatically uses any custom inspectors and drawers you set for the data.

object database editor window function

– switch

between different database types-enable / disable different types when many different database types confuse your view.

– Select, create, and delete databases and ScriptableObjects

– create any subclasses of type ScriptableObjects by clicking the button twice.

– rearranges the order of assets in the list.

– View and modify any serializable data contained in ScriptableObjects in the editor window.

– all custom inspectors and property drawers

are supported by default-drag and drop compatible objects to the asset list to quickly add existing objects

– import external objects into the database as copies Or keep the data external and store references

-copy objects and add them to the database

,

,

,

database type creator function

-choose where to create the database in the dependency chain. The database will then be able to save and create all types inherited from that base type, ignoring abstract types.

-naming the database type used for file and class naming. For example, ‘ItemAssetDatabase’

-choose the location

for your runtime and the editor script you created-as soon as a new database type is created, the asset database editor window will immediately select it

,

,

,

to create the ScriptableObject asset database to meet my organizational and efficient workflow needs. I want to be able to create a simple database to store any type of Unity objects I can create and to be able to create them in less than 30 seconds, including recompilation time. It is minimalist and effectively achieves these two goals with minimal confusion.

with this in mind, I do not use custom icons or texture data. The code is compiled into two DLL, one for the runtime and one for the editor. It also includes two EditorDefaultResource files that are used as runtime and editor class templates. The result classes and files created from these templates use 44 lines of code for any database you want to create. The

basic database class not only applies to ScriptableObjects, but also easily overrides some methods in the database generic classes to allow prefabricated or custom databases. If you know how to code, it should be trivial to create a database for any type of project data you can imagine when extending the underlying database class.

function in the plan

-move the existing ScriptableObject to the database and update all references to

in the project-use embedded resources to store template files in dll