예제 #1
0
    private void ApplyTooltip(Vector3Int mapPosition, SelectionCoinController coinController, BuildingManager.BuildingAction buildingAction)
    {
        GameObject        buildingLogic = BuildingManager.instance._positionToBuildingLogic[mapPosition];
        BuildingHealth    health        = buildingLogic.GetComponent <BuildingHealth>();
        BuildingLogicBase logic         = buildingLogic.GetComponent <BuildingLogicBase>();

        switch (buildingAction)
        {
        case BuildingManager.BuildingAction.UPGRADE_HEALTH:
            coinController.titleText = "Upgrade: Add Walls";
            coinController.bodyText  = "Add walls to the building, upgrading its health.";
            coinController.cost      = BuildingManager.GetHealthUpgradeCost(health);
            coinController.benefit   = health.PredictHealthUpgradeIncrease();
            return;

        case BuildingManager.BuildingAction.UPGRADE_PRODUCTION:
            coinController.titleText = "Upgrade: Renovate Building";
            coinController.bodyText  = "Improve the efficiency of this building.";
            coinController.cost      = BuildingManager.GetProductionUpgradeCost(logic);
            return;

        case BuildingManager.BuildingAction.REPAIR:
            coinController.titleText = "Repair";
            coinController.bodyText  = "Repair this building to full health. Cost based on damage.";
            coinController.cost      = BuildingManager.instance.GetRepairCost(health);
            coinController.benefit   = health.MaxHealth - health.CurrentHealth;
            return;
        }
    }