예제 #1
0
    void Start()
    {
        iconContol = FindObjectOfType<IconController>();
        hex = GetComponentInParent<Hex>();
        icon = GetComponent<Image>();

        hexClimate = hex.GetClimate();
        prevClimate = hexClimate;

        icon.color = iconContol.GetHexClimateColor(hexClimate);
    }
예제 #2
0
    //Measures survival Score to determine Critter health in environment.
    public float SurvivalScore(Hex habitat)
    {
        float score = 0;
        int num;

        num = (int)habitat.GetBiomeType();
        score += biomePref[num];

        num = (int)habitat.GetClimate();
        score += GetClimatePref(num);

        num = (int)habitat.GetGeography();
        score += geoPref[num];

        num = (int)habitat.GetTemp();
        score += GetTempPref(num);

        return score;
    }