private void updateFoodAvailable() { // Profiler.BeginSample("updateFoodAvailable"); transformsFood.Clear(); foreach (GameObject go in FoodProducer.getAllFoods()) { transformsFood.Add(go.transform.position); } // Profiler.EndSample(); }
private void getAllFieldStats() { foodAmountAvailableAllFoods = new List <double>(); transformsFood = new List <Vector3>(); gameObjectsFood = new List <GameObject>(); foreach (GameObject go in FoodProducer.getAllFoods()) { foodAmountAvailableAllFoods.Add(go.GetComponent <FoodStats>().foodAmountAvailable); transformsFood.Add(go.transform.position); gameObjectsFood.Add(go); } transformsPoison = new List <Vector3>(); gameObjectsPoison = new List <GameObject>(); foreach (GameObject go in FoodProducer.getAllPoisons()) { transformsPoison.Add(go.transform.position); gameObjectsPoison.Add(go); } }