Esempio n. 1
0
        static bool Load(UnityModManager.ModEntry modEntry)
        {
            try
            {
                settings      = Settings.Load <Settings>(modEntry);
                mod           = modEntry;
                mod.OnToggle  = OnToggle;
                mod.OnUpdate  = OnUpdate;
                mod.OnGUI     = OnGUI;
                mod.OnSaveGUI = OnSaveGUI;
#if DEBUG
                modEntry.OnUnload = Unload;
#endif
                var harmony = new Harmony(modEntry.Info.Id);
                harmony.PatchAll(Assembly.GetExecutingAssembly());

                AsyncManager.Initialize();

                ActiveRoute = new ActiveRoute();

                modEntry.Logger.Log("RouteManager initialized");

                Terminal.Log($"Load, audio source {generalAudioSource}");
            }
            catch (Exception exc)
            {
                modEntry.Logger.LogException(exc);
            }

            return(true);
        }