Beispiel #1
0
    void Update()
    {
        if (!InFailure)
        {
            if (Heater.IsOn)
            {
                PilotLightOutFailure.CheckForFailure(Time.deltaTime);
            }
            else
            {
                ACFrozenFailure.CheckForFailure(Time.deltaTime);
            }
        }

        PilotLightOutIndicator.isOn = PilotLightOutFailure.InFailure;
        ACFrozenIndicator.isOn      = ACFrozenFailure.InFailure;

        CheckForNewRandomTempForce(Time.deltaTime);
        var hvacForce     = GetHvacForce(tempSetting, Heater.IsOn, ACFrozenFailure.InFailure, PilotLightOutFailure.InFailure);
        var tempForceDiff = externalTempForce + hvacForce;

        if (Mathf.Abs(tempForceDiff) <= .1f)
        {
            tempForceDiff = 0;
        }

        currentTemp += Time.deltaTime * tempForceDiff;
        currentTemp  = Mathf.Clamp01(currentTemp);
        TemperatureIndicator.TrueValue = currentTemp;
    }
Beispiel #2
0
    void Update()
    {
        bool inFailure = FailureEvent.CheckForFailure(Time.deltaTime);

        FailureIndicator.isOn = inFailure;

        TrashLevel = Mathf.Clamp(TrashLevel + Time.deltaTime * TrashBuildRate, 0, MaxTrashCapacity);
        TrashLevelIndicator.TrueValue = TrashLevel / MaxTrashCapacity;
    }