mirror of
https://gitee.com/ccc_28/level-render
synced 2025-11-15 18:48:17 +00:00
demo
This commit is contained in:
18
assets/demo/Item.ts
Normal file
18
assets/demo/Item.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Label } from 'cc';
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
export interface IItem {
|
||||
id: number
|
||||
}
|
||||
@ccclass('Item')
|
||||
export class Item extends Component {
|
||||
@property(Label)
|
||||
lbl: Label = null;
|
||||
|
||||
setData(p: IItem) {
|
||||
this.lbl.string = `${p.id}`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user