// Learn TypeScript: // - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html // Learn Attribute: // - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html // Learn life-cycle callbacks: // - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html const { ccclass, property } = cc._decorator; @ccclass export default class Prop extends cc.Component { //道具ID标识 id_Flag = '' //子地图的id序号 SubMap = '' //元素道具的fs信息 fs: { sp: number, ro: number, sc: number, x: number, y: number, } = null Flag(): string { // return this.node.parent.name + this.name + this.node.getPosition().x + this.node.getPosition().y return this.SubMap + this.fs?.sp.toString() + this.fs?.x.toString() + this.fs?.y.toString() } }