Exemplo n.º 1
0
 void Awake()
 {
     //Set the target frame rate.
     Application.targetFrameRate = targetFPS;
     //Allow controller input to be processed.
     inputActions = new DroneController();
     OnEnable();
     ProcessInput();
     //Instantiate the FMU
     fmu = new FMU("DroneSimulation_Polling", name);
     fmu.Reset();
     fmu.SetupExperiment(Time.time);
     fmu.EnterInitializationMode();
     fmu.ExitInitializationMode();
 }
Exemplo n.º 2
0
    public void Reset()
    {
        // reset the FMU
        fmu.Reset();

        // start the experiment at the current time
        fmu.SetupExperiment(Time.time);

        fmu.EnterInitializationMode();

        // set the start values for variables "h" and "e"
        fmu.SetReal("h", initalHeight);
        fmu.SetReal("e", reboundFactor);

        fmu.ExitInitializationMode();
    }
Exemplo n.º 3
0
    public void Reset()
    {
        // reset the FMU
        fmu.Reset();

        // start the experiment at the current time
        fmu.SetupExperiment(Time.time);

        // initialize
        fmu.EnterInitializationMode();
        fmu.ExitInitializationMode();

        // sync UI
        realInSlider.value = (float)fmu.GetReal(vr_x);
        realOutText.text   = realInSlider.value.ToString();

        intInSlider.value = fmu.GetInteger(vr_int_in);
        intOutText.text   = intInSlider.value.ToString();

        boolInToggle.isOn = fmu.GetBoolean(vr_bool_in);
        boolOutText.text  = boolInToggle.isOn.ToString();

        stringOutText.text = stringInInputField.text = fmu.GetString(vr_string_in);
    }