void OnGUI() { if (GUI.Button(new Rect(10, 100, 100, 20), "Respawn")) { walker.RespawnRandomly(); } }
public void SpawnNewFood() { GameObject food = UnityEngine.Object.Instantiate(foodPrefab); walker.RespawnRandomly(); walker.WriteToTransform(food.transform); OnFoodSpawned?.Invoke(food); }