舒適提示:閱讀本文你的電腦須要安裝好apktool、signapk、.NET Reflector、dnSpy。他們均可以在github或吾愛雲盤上獲取。git
assets/bin/Data/Managed
下的Assembly-CSharp.dll
動態庫文件中,C#的dll文件不難分析,咱們使用.NET Reflector和dnSpy進行分析和修改。SetInfoPanelData
方法和PushRollButton
方法。首先查看SetInfoPanelData
方法,發現是進行商品購買的邏輯代碼,代碼以下:public void SetInfoPanelData(int shopIndex, Vector3 pos) { if (shopIndex == -1) { this.unsetCursor(); this.InfoPanel.GetComponent<InfoPanel>().SetInfoPanel(-1); } else if (Mathf.Abs(this.flickMove) <= (this.S_FlickChecker.flickMin / 3f)) { if (this.selectShopIndex != shopIndex) { this.InfoPanel.GetComponent<InfoPanel>().SetInfoPanel(shopIndex); this.selectShopIndex = shopIndex; this.setCursor(pos); SuperGameMaster.audioMgr.PlaySE(Define.SEDict["SE_Cursor"]); } else { ShopDataFormat format = SuperGameMaster.sDataBase.get_ShopDB(shopIndex); ItemDataFormat format2 = SuperGameMaster.sDataBase.get_ItemDB_forId(format.itemId); if (format2 != null) { if (!format2.spend && (SuperGameMaster.FindItemStock(format2.id) != 0)) { SuperGameMaster.audioMgr.PlaySE(Define.SEDict["SE_Cancel"]); } else if (SuperGameMaster.CloverPointStock() >= format2.price) { if (SuperGameMaster.FindItemStock(format.itemId) < 0x63) { <SetInfoPanelData>c__AnonStorey1 storey = new <SetInfoPanelData>c__AnonStorey1 { $this = this }; base.GetComponent<FlickCheaker>().stopFlick(true); storey.confilm = this.ConfilmUI.GetComponent<ConfilmPanel>(); if (format2.type == Type.LunchBox) { storey.confilm.OpenPanel_YesNo(string.Concat(new object[] { format2.name, "\nを買いますか?\n(所持數 ", SuperGameMaster.FindItemStock(format.itemId), ")" })); } else { storey.confilm.OpenPanel_YesNo(format2.name + "\nを買いますか?"); } storey.confilm.ResetOnClick_Yes(); storey.confilm.SetOnClick_Yes(new UnityAction(storey, (IntPtr) this.<>m__0)); storey.confilm.SetOnClick_Yes(new UnityAction(storey, (IntPtr) this.<>m__1)); storey.confilm.SetOnClick_Yes(new UnityAction(storey, (IntPtr) this.<>m__2)); storey.confilm.ResetOnClick_No(); storey.confilm.SetOnClick_No(new UnityAction(storey, (IntPtr) this.<>m__3)); storey.confilm.SetOnClick_No(new UnityAction(storey, (IntPtr) this.<>m__4)); } else { <SetInfoPanelData>c__AnonStorey2 storey2 = new <SetInfoPanelData>c__AnonStorey2 { $this = this }; base.GetComponent<FlickCheaker>().stopFlick(true); storey2.confilm = this.ConfilmUI.GetComponent<ConfilmPanel>(); storey2.confilm.OpenPanel("もちものがいっぱいです"); storey2.confilm.ResetOnClick_Screen(); storey2.confilm.SetOnClick_Screen(new UnityAction(storey2, (IntPtr) this.<>m__0)); storey2.confilm.SetOnClick_Screen(new UnityAction(storey2, (IntPtr) this.<>m__1)); } } else { <SetInfoPanelData>c__AnonStorey3 storey3 = new <SetInfoPanelData>c__AnonStorey3 { $this = this }; base.GetComponent<FlickCheaker>().stopFlick(true); storey3.confilm = this.ConfilmUI.GetComponent<ConfilmPanel>(); storey3.confilm.OpenPanel("みつ葉が足りません"); storey3.confilm.ResetOnClick_Screen(); storey3.confilm.SetOnClick_Screen(new UnityAction(storey3, (IntPtr) this.<>m__0)); storey3.confilm.SetOnClick_Screen(new UnityAction(storey3, (IntPtr) this.<>m__1)); } } } } }
SuperGameMaster.CloverPointStock() >= format2.price
SuperGameMaster
的CloverPointStock
方法是得到三葉草數量的方法,進入查看該方法:public static int CloverPointStock() { return SuperGameMaster.saveData.CloverPoint; }
public static int CloverPointStock() { return 9876; }
PushRollButton
方法,獲得代碼:public void PushRollButton() { if (SuperGameMaster.TicketStock() < 5) { <PushRollButton>c__AnonStorey0 storey = new <PushRollButton>c__AnonStorey0 { confilm = this.ConfilmUI.GetComponent<ConfilmPanel>() }; storey.confilm.OpenPanel("ふくびき券が足りません"); storey.confilm.ResetOnClick_Screen(); storey.confilm.SetOnClick_Screen(new UnityAction(storey, (IntPtr) this.<>m__0)); } else { SuperGameMaster.GetTicket(-5); SuperGameMaster.set_FlagAdd(Type.ROLL_NUM, 1); base.GetComponentInParent<UIMaster>().freezeObject(true); base.GetComponentInParent<UIMaster>().blockUI(true, new Color(0f, 0f, 0f, 0.3f)); this.LotteryCheck(); this.ResultButton.GetComponent<RollResultButton>().CngImage((int) this.result); this.ResultButton.GetComponent<RollResultButton>().CngResultText(Define.PrizeBallName[this.result] + "がでました"); this.LotteryWheelPanel.GetComponent<LotteryWheelPanel>().OpenPanel(this.result); SuperGameMaster.SetTmpRaffleResult((int) this.result); SuperGameMaster.SaveData(); SuperGameMaster.audioMgr.PlaySE(Define.SEDict["SE_Raffle"]); this.BackFunc(); } }
if (SuperGameMaster.TicketStock() < 5)
SuperGameMaster.GetTicket(-5); SuperGameMaster.set_FlagAdd(Type.ROLL_NUM, 1);
TicketStock
方法的返回值更省事,使用dnSpy按一樣的方法修改代碼,原來方法爲:public static int TicketStock() { return SuperGameMaster.saveData.ticket; }
public static int TicketStock() { return 5; }