private void Update() { if (SR.GameContextLoaded && !gameContextLoaded) { SR.MessageDir.RegisterBundlesListener(dir => OnBundlesAvailable?.Handle(args: new object[] { dir }, unique: true)); SR.InputDir.onKeysChanged += () => OnKeysChanged?.Handle(unique: true); SR.ProgressDir.onProgressChanged += () => OnProgressChanged?.Handle(unique: true); gameContextLoaded = true; } if (SR.SceneContextLoaded && !sceneContextLoaded) { SR.EcoDir.didUpdateDelegate += () => OnPricesReset?.Handle(unique: true); SR.EcoDir.onRegisterSold += id => OnRegisterSold?.Handle(args: new object[] { id }, unique: true); SR.SlimeAppDir.onSlimeAppearanceChanged += (def, app) => OnSlimeAppearanceChanged?.Handle(args: new object[] { def, app }, unique: true); SR.ExchangeDir.onOfferChanged += () => OnOfferChanged?.Handle(unique: true); SR.TimeDir.onFastForwardChanged += state => OnFastForward?.Handle(args: new object[] { state }, unique: true); sceneContextLoaded = true; } OnGameUpdate?.Invoke(SR.Game, SR.Scene); }
//? Message Director internal void OnBundlesAvailable_Trigger(MessageDirector dir) => OnBundlesAvailable?.Handle(args: new object[] { dir }, unique: true);