コード例 #1
0
    void FixedUpdate()
    {
        // Update player stats
        HealthText.text = "Health: " + playerResources.HealthState + " (" + playerResources.Health + ")";
        HungerText.text = "Hunger: " + playerResources.HungerState + " (" + playerResources.Hunger + ")";
        ThirstText.text = "Thirst: " + playerResources.ThirstState + " (" + playerResources.Thirst + ")";
        EnergyText.text = "Energy: " + playerResources.EnergyState + " (" + playerResources.Energy + ")";

        // Update time
        TimeText.text = TimeManager.Instance.CurrentDayTimeFormatted;

        // Update ship stats
        FoodText.text                 = "Food: " + shipResources.StoredFood;
        WaterText.text                = "Water: " + shipResources.StoredWater;
        StoredOxygenText.text         = "Stored oxygen: " + shipResources.StoredOxygen;
        OxygenLevelText.text          = "Oxygen level: " + shipResources.OxygenLevel + "%";
        OyxgenLevelTextOnMachine.text = "Oxygen in air:\n" + shipResources.OxygenLevel + "%";
        TemperatureText.text          = "Temperature: " + shipResources.Temperature;
        StoredEnergyText.text         = "Stored energy: " + shipResources.StoredEnergy;
        PowerUsageText.text           = "Power usage: " + systemManager.GetPowerUsage();
        PowerProductionText.text      = "Power production: " + systemManager.GetPowerProduction();
        NetPowerText.text             = "Net power: " + (systemManager.GetPowerProduction() - systemManager.GetPowerUsage());

        if (eventTimer > 0)
        {
            eventTimer -= Time.deltaTime;
        }
        if (eventTimer <= 0)
        {
            EventBox.SetActive(false);
        }
    }