private void LoadDice(object param, System.Action <int> callback) { FusionAudio.PostEvent("UI/New/Dice", true); string path = "_GameAssets/Res/MISC/Dice/DiceObj"; int num = int.Parse(param.ToString()); if (DiceCom != null) { InitDice(num, callback); return; } EB.Assets.LoadAsync(path, typeof(GameObject), o => { if (!o) { return; } GameObject diceObj = GameObject.Instantiate(o) as GameObject; diceObj.transform.parent = controller.transform; diceObj.transform.localScale = Vector3.one; DiceCom = diceObj.GetComponent <TouziTest>(); if (DiceCom != null) { InitDice(num, callback); return; } }); }
private void LoadDice(int num, System.Action <int> callback) { InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 3f); FusionAudio.PostEvent("UI/New/Dice", true); if (DiceCom != null) { InitDice(num, callback); return; } string path = "_GameAssets/Res/MISC/Dice/DiceObj"; EB.Assets.LoadAsync(path, typeof(GameObject), o => { if (!o) { return; } GameObject diceObj = GameObject.Instantiate(o) as GameObject; diceObj.transform.parent = controller.transform; diceObj.transform.localScale = Vector3.one; DiceCom = diceObj.GetComponent <TouziTest>(); if (DiceCom != null) { InitDice(num, callback); return; } }); }