private void CreateCoin() { if (_labyrinth == null) { return; } GameObject coin = Instantiate(coinPrefab, gameObject.transform); LFLabyrinthNode spawnNode = _labyrinth.RandomFreeNode(); //int z = 0; coin.transform.position = spawnNode.WorldPosition; //new Vector3 (spawnNode.WorldPosition.x, spawnNode.WorldPosition.y, z); _coins.Add(coin); }
public void CreatePing() { if (_labyrinth == null || pingPrefab == null) { return; } LFLabyrinthNode spawnNode = _labyrinth.RandomFreeNode(); GameObject pig = Instantiate(pingPrefab, spawnNode.WorldPosition, Quaternion.identity); pig.transform.parent = animalContainer.transform; pig.GetComponent <LFAnimalMove>().pathFinder = _pathFinder; pig.GetComponent <LFAnimalMove>().speed = startPingSpeed; pig.SetActive(true); _animalList.Add(pig); }