Monday, January 26, 2026
spot_img

Customized Asset Help 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 information (JSON, photographs, prefabs, and so on.) and assign them to @property fields in Elements.


My Aim

I need to create my very own customized asset kind.

Instance:

  • Create a customized file: .pts or .check
  • Retailer my very own information
  • Drag this file into the Inspector
  • Use it like a standard 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 Downside

Cocos Creator doesn’t acknowledge .pts information as legitimate belongings:

  • Can not assign in Inspector
  • Not transformed to customized Asset
  • Not importable

Query

How do I make Cocos Creator:

  • Acknowledge customized file sorts
  • Import them as Belongings
  • 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, a minimum of on Home windows, evidently some element is lacking for the extension to work correctly.
Since your class extends Asset, you need to use @property({ kind: Asset }) newDataFile: PleaseWork; and drag and drop will work, nonetheless with out proscribing the asset kind to the specified file kind.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -spot_img

Latest Articles