Beispiel #1
0
    /// <summary>
    /// Applies a modifier to caravan motion values as relative factor (e.g. 0.5 = +50%)
    /// </summary>
    /// <param name="accelerationFactorMod">The relative variation to apply to the caravan's acceleration factor</param>
    /// <param name="maxSpeedFactorMod">The relative variation to apply to the caravan's maxSpeed factor</param>
    /// <param name="duration">How long this effect should  last</param>
    public void AddModifier(float accelerationFactorMod, float maxSpeedFactorMod, float duration)
    {
        Debug.Log("Accelerating!");
        var newMod = new Modifier(accelerationFactorMod, maxSpeedFactorMod, duration);

        currentModifiers.Add(newMod);
        newMod.ApplyTo(this);
    }