示例#1
0
 void OnGUI()
 {
     if (GUI.Button(new Rect(10, 100, 100, 20), "Respawn"))
     {
         walker.RespawnRandomly();
     }
 }
示例#2
0
        public void SpawnNewFood()
        {
            GameObject food = UnityEngine.Object.Instantiate(foodPrefab);

            walker.RespawnRandomly();
            walker.WriteToTransform(food.transform);

            OnFoodSpawned?.Invoke(food);
        }