Ejemplo n.º 1
0
    /// <summary>
    /// Evaluates the sunlight satisfaction of a sunlight definition for the given sunlight type.
    /// </summary>
    public float EvaluateSunlightSatisfaction(SunlightDefinition.Sunlight sun)
    {
        for (int i = sunlightDefinitions.Count; i-- > 0;)
        {
            if (sunlightDefinitions[i].Need == sun)
            {
                return(sunlightDefinitions[i].Satisfaction.Evaluate(EnvironmentData.Instance.SunIntensity));
            }
        }

        Debug.LogError("[SunlightManifest] Unable to find sunlight definition: " + sun.ToString());
        return(0f);
    }
Ejemplo n.º 2
0
    public AnimationCurve GetSunlightSatisfactionCurve(SunlightDefinition.Sunlight sun)
    {
        for (int i = sunlightDefinitions.Count; i-- > 0;)
        {
            if (sunlightDefinitions[i].Need == sun)
            {
                return(sunlightDefinitions[i].Satisfaction);
            }
        }

        Debug.LogError("[SunlightManifest] Unable to find sunlight definition: " + sun.ToString());
        return(null);
    }