示例#1
0
    public void Setup()
    {
        if (failureEnabled)
        {
            Debug.Log($"TestVAR: {testVar}");
            testVar = "Setup";
            Debug.Log($"TestVAR: {testVar}");
            playersVehicle = VTOLAPI.instance.GetPlayersVehicleGameObject();
            Debug.Log($"Running Setup for {failureName}");
            if (hourlyFailureRate != 0.0)
            {
                failureRate = hourlyFailureRate / 3600;
                Debug.Log($"Hourly failure rate {hourlyFailureRate} for {failureName} is {failureRate}");
            }

            flightWarnings = playersVehicle.GetComponentInChildren <FlightWarnings>();


            Debug.Log("Setting up HUD");
            SetupHUDWarning();

            flightWarning = AddWarning($"{failureName}", warningAudio);
            //SetHUDWarningText($"{failureName}");

            if (flightWarning == null)
            {
                Debug.Log("Flight Warning Not Created");
            }
            Debug.Log(HUDWarning.warnText.text);
            Debug.Log("Running specific setup");
            SetupSpecific();
        }
    }
示例#2
0
    static void Postfix(FlightWarnings __instance)
    {
        if (CustomBetty.instance.currentCommonWarnings != null)
        {
            Debug.Log("Replacing flight warnings");
            Traverse traverse = new Traverse(__instance);

            __instance.commonWarningsClips = CustomBetty.instance.currentCommonWarnings;
            traverse.Field("cwp").SetValue(__instance.commonWarningsClips.ToArray());
        }
    }