private void ServeBeerToTable(PlayerBeer playerBeer) { float playerBeerAmount = playerBeer.BeerAmount(); float ServeableBeerAmount = Mathf.Min(playerBeerAmount, m_maximumBeerAmount - m_beerAmount); m_beerAmount += ServeableBeerAmount; m_totalBeerAmount += ServeableBeerAmount; playerBeer.ServeBeer(ServeableBeerAmount); }
public void Update() { if (m_localPlayerBeer == null) { return; } PlayerBeerState currentState; if (m_localPlayerBeer.HasToGetMoney()) { currentState = PlayerBeerState.BarrelToken; } else if (m_localPlayerBeer.BeerAmount() > 0) { currentState = PlayerBeerState.BarrelFull; } else { currentState = PlayerBeerState.BarrelEmpty; } if (currentState != m_previousState) { m_previousState = currentState; switch (currentState) { case PlayerBeerState.BarrelFull: m_icon.texture = m_barrelFull; break; case PlayerBeerState.BarrelToken: m_icon.texture = m_barrelToken; break; case PlayerBeerState.BarrelEmpty: m_icon.texture = m_BarrelEmpty; break; } } }