Prop.ts 904 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Learn TypeScript:
  2. // - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
  3. // Learn Attribute:
  4. // - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
  5. // Learn life-cycle callbacks:
  6. // - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
  7. const { ccclass, property } = cc._decorator;
  8. @ccclass
  9. export default class Prop extends cc.Component {
  10. //道具ID标识
  11. id_Flag = ''
  12. //子地图的id序号
  13. SubMap = ''
  14. //元素道具的fs信息
  15. fs: {
  16. sp: number,
  17. ro: number,
  18. sc: number,
  19. x: number,
  20. y: number,
  21. } = null
  22. Flag(): string {
  23. // return this.node.parent.name + this.name + this.node.getPosition().x + this.node.getPosition().y
  24. return this.SubMap + this.fs?.sp.toString() + this.fs?.x.toString() + this.fs?.y.toString()
  25. }
  26. }