예제 #1
0
    public void SetTravelCost(TravelCost cost)
    {
        if (cost != null)
        {
            _routeStats.gameObject.SetActive(true);

            _routeStats.SetStat(TimeCostStatName, cost.Time);
            _routeStats.SetStatState(TimeCostStatName, GameData.HasEnoughTime(cost.Time) ? StatState.Ok : StatState.Error);

            _routeStats.SetStat(HealthCostStatName, cost.Health);
            _routeStats.SetStatState(HealthCostStatName, GameData.HasEnoughHealth(cost.Health) ? StatState.Ok : StatState.Error);

            _routeStats.SetStat(FuelCostStatName, cost.Fuel);
            _routeStats.SetStatState(FuelCostStatName, GameData.HasEnoughFuel(cost.Fuel) ? StatState.Ok : StatState.Error);
        }
        else
        {
            _routeStats.gameObject.SetActive(false);
        }
    }