Monday, February 2, 2026
spot_img

Customized Asset Assist in Cocos Creator (3.8.x) – Cocos Creator


In Cocos Creator, there are built-in asset sorts like:

  • cc.JsonAsset
  • cc.SpriteFrame
  • cc.Prefab

These enable us to import recordsdata (JSON, pictures, prefabs, and so forth.) and assign them to @property fields in Parts.


My Purpose

I wish to create my very own customized asset sort.

Instance:

  • Create a customized file: .pts or .take a look at
  • Retailer my very own information
  • Drag this file into the Inspector
  • Use it like a traditional asset in @property

What I Tried

Customized Asset Class

import { Asset, _decorator } from 'cc';

const { ccclass } = _decorator;

@ccclass("PleaseWork")
export class PleaseWork extends Asset {}

Editor Extension

  • Created extension
  • Used and
  • Edited .meta importer
  • Adopted official docs

However it nonetheless doesn’t work.


Present Drawback

Cocos Creator doesn’t acknowledge .pts recordsdata as legitimate property:

  • Can’t assign in Inspector
  • Not transformed to customized Asset
  • Not importable

Query

How do I make Cocos Creator:

  • Acknowledge customized file sorts
  • Import them as Property
  • Bind them to customized courses

Like JsonAsset or Prefab?

Please assist. Thanks!

  • Adopted official docs
    However it nonetheless doesn’t work.

I attempted following the documentation and certainly, at the least on Home windows, plainly some element is lacking for the extension to work correctly.
Since your class extends Asset, you should utilize @property({ sort: Asset }) newDataFile: PleaseWork; and drag and drop will work, nonetheless with out proscribing the asset sort to the specified file sort.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -spot_img

Latest Articles