Exactly. it is different way of thinking logic, but this is getting closer to the way Game Developer thinking, much more O-O orient
and... I hope I am not taking too much of your time, I try to micmic your code and change the total number of turn that I can use, so I had below diff
adding below to var cheats
StopCount:["PuzzleUI","notUsed","ONE","SELF","ON","stopCount"]
and have below under togglecheat
PuzzlePlayer.stopCount = function(){
appendLog("this.m_nTurnNumber= "+this.m_nTurnNumber)
this.m_nTurnNumber = 15;
}
let PuzzleUI = new UnityObject(PuzzlePlayer.PuzzleUI)
PuzzleUI.loadFields(["m_nTurnNumber","LootTurnRuneCount"])
// this.m_nTurnNumber = this.LootTurnRuneCount
appendLog("m_nTurnNumber= "+this.m_nTurnNumber+" : LootTurnRuneCount ="+this.LootTurnRuneCount)
I thought I can print out the turn number, but always I get undefined.
I am sure in PuzzleUI, there is such field, and in PuzzlePlayer, there is an instance of PuzzleUI
My code here https://www.icloud.com/iclouddrive/0ebWuS2833pIaaBca7M-q3viQ#H5JSPlugin_-_Gem_of_War
thank you so much..