Skip to content

Commit

Permalink
优化实现
Browse files Browse the repository at this point in the history
  • Loading branch information
shabbywu committed Jan 7, 2022
1 parent e0b3aba commit 09fbf00
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ jobs:
bin/michangsheng/ShoterLearnTime.dll
bin/michangsheng/BetterShoppingExperience.dll
bin/michangsheng/InstantlyForgeAndRefine.dll
bin/michangsheng/CollectGains.dll
13 changes: 11 additions & 2 deletions michangsheng/BetterShoppingExperience/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using BepInEx;
using HarmonyLib;

using GUIPackage;
using UnityEngine.Events;
using JiaoYi;
using UnityEngine;

Expand All @@ -14,6 +14,8 @@ namespace BetterShoppingExperience
public class Plugin : BaseUnityPlugin
{

static UnityAction closeAction;

private void Awake()
{
// Plugin startup logic
Expand Down Expand Up @@ -66,7 +68,14 @@ private void Update() {
int next = findNext(o, currentId);;
Console.WriteLine("Current" + currentId + ", next id = " + next);

__instance.Init(next);
// stop closeAction
closeAction = __instance.CloseAction;

__instance.CloseAction = delegate() {};
__instance.Close();

ResManager.inst.LoadPrefab("JiaoYiUI").Inst(NewUICanvas.Inst.transform);
JiaoYiUIMag.Inst.Init(next, closeAction);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions michangsheng/CollectGains/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ private void Awake()
// Plugin startup logic
Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");

Harmony.CreateAndPatchAll(typeof(Plugin));
Harmony.CreateAndPatchAll(typeof(CollectGains));
}
}

[HarmonyPatch(typeof(CaiJiUIMag), "StartCaiJi")]
public class InstantlyRefine {
public class CollectGains {
static readonly object _object = new object();

static Harmony singleton;
Expand Down

0 comments on commit 09fbf00

Please sign in to comment.