| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- import { Vec3, v3 } from "cc";
- import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
- import { VM } from "../../../../../extensions/oops-plugin-framework/assets/libs/model-view/ViewModel";
- import { SubwayEnum } from "./SubwayEnum";
- import { SingletonModuleComp } from "../../common/SingletonModuleComp";
- @ecs.register('SubwayModel')
- export class SubwayModelComp extends ecs.Comp {
- private vm: any = {};
- private _color: string = "";
- private _type: SubwayEnum = SubwayEnum.LEFT
- private _path: string = ""
- private _capcity: number = 3
- private _useSit: number = 0
- get isFull(): boolean {
- return this._useSit >= this._capcity
- }
- /** 颜色 */
- get color(): string {
- return this._color;
- }
- set color(value: string) {
- this._color = value;
- }
- /** 模型类型 左-右 */
- get type(): SubwayEnum {
- return this._type;
- }
- set type(value: SubwayEnum) {
- this._type = value;
- // this.vm.type = value;
- }
- /** 模型路径 */
- get path(): string {
- return this._path;
- }
- set path(value: string) {
- this._path = value;
- // this.vm.path = value;
- }
- /** 容量 */
- get capcity(): number {
- return this._capcity;
- }
- set capcity(value: number) {
- this._capcity = value;
- // this.vm.capcity = value;
- }
- /** 上车席位 */
- get useSit(): number {
- return this._useSit;
- }
- set useSit(value: number) {
- this._useSit = value;
- // this.vm.useSit = value;
- }
- // vmAdd() {
- // VM.add(this.vm, "Subway");
- // }
- // vmRemove() {
- // this.vm.reset();
- // VM.remove("Subway");
- // }
- reset() {
- // this.vmRemove();
- }
- }
|