Exemplo n.º 1
0
    public AnimationCurve GetWaterSatisfactionCurve(WaterDefinition.Moisture water)
    {
        for (int i = waterDefinitions.Count; i-- > 0;)
        {
            if (waterDefinitions[i].Need == water)
            {
                return(waterDefinitions[i].Satisfaction);
            }
        }

        Debug.LogError("[WaterManifest] Unable to find water definition: " + water.ToString());
        return(null);
    }
Exemplo n.º 2
0
    /// <summary>
    /// Evaluates the water satisfaction of a water definition for the given water type.
    /// </summary>
    public float EvaluateWaterSatisfaction(WaterDefinition.Moisture water, float waterLevel)
    {
        for (int i = waterDefinitions.Count; i-- > 0;)
        {
            if (waterDefinitions[i].Need == water)
            {
                return(waterDefinitions[i].Satisfaction.Evaluate(waterLevel));
            }
        }

        Debug.LogError("[WaterManifest] Unable to find water definition: " + water.ToString());
        return(0f);
    }