import { ITransitionActions , SerialFormat , State , TGroupHandle } from "sim-ecs" ; import { menuPrefab } from "../prefabs/menu" ; import { GameStore } from "../models/game-store" ; export class MenuState extends State { prefabHandle ! : TGroupHandle ; activate ( actions ) { actions . getResource ( GameStore ) . currentState = this ; this . prefabHandle = actions . commands . load ( SerialFormat . fromArray ( menuPrefab ) ) ; actions . commands . maintain ( ) ; } deactivate ( actions ) { actions . commands . unloadPrefab ( this . prefabHandle ) ; actions . commands . maintain ( ) ; } }