private void buy() { GameObject go = UIManager.OpenUI(Config.UI.UIPath.ContanerSelectPanel); ContanerSelectView list = go.GetComponent <ContanerSelectView>(); list.setCallback((id) => { Destroy(go); Mod.Cabinet cabinet = Mod.Cabinet.GetById(id); GameObject pay = UIManager.OpenUI(Config.UI.UIPath.PayPanel); PayView pv = pay.GetComponent <PayView>(); pv.amount = cabinet.Good().Price; }); }
private void playGame() { // startGame(false); if (Coin.GetInstance().afford()) { GameObject gl = UIManager.OpenUI(Config.UI.UIPath.ContanerSelectPanel); ContanerSelectView list = gl.GetComponent <ContanerSelectView>(); list.setCallback((id) => { Destroy(gl); Coin.GetInstance().consume(id); startGame(false); }); return; } GameObject go = UIManager.OpenUI(Config.UI.UIPath.PayPanel); PayView pv = go.GetComponent <PayView>(); pv.amount = 4; }