/// <summary>
    /// Restarts the simulation using a specific preset to choose the
    /// initial conditions.
    /// </summary>
    public void RestartSimulation(EcosystemPreset preset,
                                  ResetBehavior resetBehavior = ResetBehavior.FadeInOut)
    {
        var presetDesc = _generator.GetPresetEcosystem(preset);

        RestartSimulation(presetDesc, resetBehavior);

        if (OnPresetLoaded != null)
        {
            OnPresetLoaded();
        }
    }
Beispiel #2
0
    public EcosystemDescription GetPresetEcosystem(EcosystemPreset preset, bool updateSliders = true)
    {
        var presetGenerator = GetComponentInChildren <PresetGenerator>();
        var description     = presetGenerator.GetPresetDescription(preset);

        if (updateSliders)
        {
            copyDescriptionToSliders(description);
        }

        return(description);
    }