VehicleModelComp.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
  2. import { VM } from "../../../../../extensions/oops-plugin-framework/assets/libs/model-view/ViewModel";
  3. @ecs.register('VehicleModelComp')
  4. export class VehicleModelComp extends ecs.Comp {
  5. private vm: any = {};
  6. private _color: string = "";
  7. private _type: string = 'car'
  8. private _path: string = ""
  9. private _capcity: number = 3
  10. private _useSit: number = 0
  11. /** 颜色 */
  12. get color(): string {
  13. return this._color;
  14. }
  15. set color(value: string) {
  16. this._color = value;
  17. }
  18. /** 模型类型 车-飞机 */
  19. get type(): string {
  20. return this._type;
  21. }
  22. set type(value: string) {
  23. this._type = value;
  24. // this.vm.type = value;
  25. }
  26. /** 模型路径 */
  27. get path(): string {
  28. return this._path;
  29. }
  30. set path(value: string) {
  31. this._path = value;
  32. // this.vm.path = value;
  33. }
  34. /** 容量 */
  35. get capcity(): number {
  36. return this._capcity;
  37. }
  38. set capcity(value: number) {
  39. this._capcity = value;
  40. // this.vm.capcity = value;
  41. }
  42. /** 上车席位 */
  43. get useSit(): number {
  44. return this._useSit;
  45. }
  46. set useSit(value: number) {
  47. this._useSit = value;
  48. // this.vm.useSit = value;
  49. }
  50. // vmAdd() {
  51. // VM.add(this.vm, "Vehicle");
  52. // }
  53. // vmRemove() {
  54. // this.vm.reset();
  55. // VM.remove("Vehicle");
  56. // }
  57. reset() {
  58. // this.vmRemove();
  59. }
  60. }