SubwayModelComp.ts 1.8 KB

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