private void UpdateGame(UseableItem playerChoice) { UpdateGameLoader updateGameLoader = new UpdateGameLoader(playerChoice); updateGameLoader.OnLoaded += OnGameUpdated; updateGameLoader.Load(); }
private void UpdateGame(UseableItem playerChoice, UseableItem opponentChoice, int bet) { UpdateGameLoader updateGameLoader = new UpdateGameLoader(playerChoice, opponentChoice, bet); updateGameLoader.OnLoaded += OnGameUpdated; updateGameLoader.load(); }
void Start() { // I move the update game loader initialization to here, to avoid garbage. _playerInfoLoader = new PlayerInfoLoader(); _playerInfoLoader.OnLoaded += OnPlayerInfoLoaded; _playerInfoLoader.Load(GameInstance.Instance.CurrentGameData.Player); _updateGameLoader = new UpdateGameLoader(); _updateGameLoader.OnLoaded += OnGameUpdated; // I am changing the name label only once instead of every frame. //Displaying the player's name _nameLabel.text = "Name: " + _player.GetName(); // I am going to reuse the wait for seconds in my coroutine _resultWaitInterval = new WaitForSeconds(_resultInterval); }