Custom asset types

Is there a possibility to have a custom asset types, inheriting after cc.Asset? I know that you obviously could create such a class, however after digging through available documentation I can’t see anything about how to create new instance of my custom asset class, like in this menu:
2018-03-27%20150336%20screenshot

For now the only way of having some kind of custom assets, is:

  1. Create new component
  2. Add to node on the scene, fill with needed data
  3. Drag node to the project, it will be saved as cc.prefab

Now you can add fields in your components for type cc.prefab, and then attach your own prefabs with component with custom data. However, this method is really awful, there is no type checking what kind of prefab I meant (what components does it include) and there is also no option of editing my custom components attached to this prefab in Assets window.

If there was an easy possibility of adding new asset type and creating instance of it, and edit it directly in the Assets window (not on the Scene) it would be really great. Think of it as of ScriptableObject concept from unity3d.

The question is, is it possible to have such a functionality? Your are using it for example for LabelAtlas type, it is custom Asset, it is saved as .labelatlas, it could be easily created and edited directly from Assets.

9 Likes