void Start() { iconContol = FindObjectOfType<IconController>(); hex = GetComponentInParent<Hex>(); icon = GetComponent<Image>(); hexTemp = hex.GetTemp(); prevTemp = hexTemp; icon.color = iconContol.GetHexTempColor(hexTemp); }
//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; }