FactorySystem.ts 601 B

1234567891011121314151617181920212223
  1. /** 工厂数据类 */
  2. import { ProductType } from "../../game/data/GameData";
  3. import { FactoryIcon } from "./FactoryIcon";
  4. const { ccclass } = cc._decorator;
  5. @ccclass
  6. export default class FactorySystem {
  7. private _currSelectFactory: FactoryIcon = null;
  8. public set currSelectFactory(factory: FactoryIcon) {
  9. this._currSelectFactory = factory;
  10. }
  11. public get currSelectFactory(): FactoryIcon {
  12. return this._currSelectFactory;
  13. }
  14. public make(id: number): void {
  15. this._currSelectFactory && this._currSelectFactory.make(id);
  16. }
  17. }