Beispiel #1
0
        private static bool OnToggle(UnityModManager.ModEntry modEntry, bool value)
        {
            if (Enabled == value)
            {
                return(true);
            }
            Enabled = value;

            if (Enabled)
            {
                Harmony = new Harmony(modEntry.Info.Id);
                Harmony.PatchAll(Assembly.GetExecutingAssembly());

                UserInterfaceHelper.CreateObjectDropperButton();
                UserInterfaceHelper.LoadUserInterface();

                PlayerController.Instance.StartCoroutine(AssetBundleHelper.LoadDefaultBundles());
                PlayerController.Instance.StartCoroutine(AssetBundleHelper.LoadUserBundles());
            }
            else
            {
                Harmony.UnpatchAll(Harmony.Id);
            }

            return(true);
        }