public static void SetupWatcher() { try { SubscriptionManager.Register(); HotloadManager.Register(); CustomDeserializer.Hook(); Loader = new HotLoader(); //UIView.library.ShowModal<MessageBoxPanel>( "MessageBoxPanel" ); // Even though both events fire when an install / download is made, // it wont be loaded twice since eventWorkshopSubscriptionChanged // fires first and that HotLoad gracefully fails because the package files // haven't been downloaded by then PlatformService.workshop.eventWorkshopItemInstalled += ( PublishedFileId packageId ) => { Profiler.Trace("eventWorkshopItemInstalled {0}", packageId); HotloadItem(packageId); }; // need for deferred loading PlatformService.workshop.eventWorkshopSubscriptionChanged += (PublishedFileId packageId, bool subscribed) => { Profiler.Trace("eventWorkshopSubscriptionChanged {0} {1}", packageId, subscribed); if (subscribed) { HotloadItem(packageId); } }; } catch (Exception ex) { Profiler.Error("SetupWatcher", ex); } }
public void OnLevelLoaded(LoadMode mode) { Settings.helper = null; HotLoader.SetupWatcher(); //GUI.DumpGameUI(); }