void Start() { rollBtn.interactable = false; rollBtn.onClick.AddListener(() => { if (!TryToConnect()) { return; } _goldModule.CmdRollDice(); _energyModule.CmdRollDice(); }); EventManager.StartListening(Constants.EVENT_REFEREE_CLIENT_ENDTURNED, new Action <uint>((turningCharacterNetId) => { if (!TryToConnect()) { return; } if (_character.netId.Value == turningCharacterNetId) { rollBtn.interactable = true; } else { rollBtn.interactable = false; } })); EventManager.StartListening(Constants.EVENT_GOLD_CHANGED, new Action <float, uint>((gold, ownNetId) => { if (!TryToConnect()) { return; } if (_character.netId.Value != ownNetId) { return; } goldTxt.text = Mathf.RoundToInt(gold).ToString(); })); EventManager.StartListening(Constants.EVENT_ENERGY_CHANGED, new Action <float, uint>((energy, ownNetId) => { if (!TryToConnect()) { return; } if (_character.netId.Value != ownNetId) { return; } energyTxt.text = Mathf.RoundToInt(energy).ToString(); })); EventManager.StartListening(Constants.EVENT_GOLD_DICE_ROLLED, new Action <int, uint>((dice, ownNetId) => { if (!TryToConnect()) { return; } if (_character.netId.Value != ownNetId) { return; } goldDiceTxt.text = dice.ToString(); })); EventManager.StartListening(Constants.EVENT_ENERGY_DICE_ROLLED, new Action <int, uint>((dice, ownNetId) => { if (!TryToConnect()) { return; } if (_character.netId.Value != ownNetId) { return; } energyDiceTxt.text = dice.ToString(); })); }
void Start() { EventManager.StartListening(Constants.EVENT_TAB_CONTENT_FIRED, new Action <string>(OnVisible)); }