nikola is a good man
This commit is contained in:
@@ -4,8 +4,7 @@ using UnityEngine;
|
||||
public class PatternSelecter : MonoBehaviour
|
||||
|
||||
{
|
||||
[SerializeField]
|
||||
private int lastTreeNumber = 8;
|
||||
public int lastTreeNumber = 8;
|
||||
public SpriteRenderer spriteRenderer;
|
||||
public Sprite endTreeSprite;
|
||||
public BoxCollider2D confine;
|
||||
|
||||
@@ -9,11 +9,18 @@ public class TreeSpawner : MonoBehaviour
|
||||
|
||||
public static int treeCount;
|
||||
|
||||
private int maxTrees;
|
||||
|
||||
|
||||
private void Start()
|
||||
{
|
||||
maxTrees = GameObject.Find("Tree").GetComponent<PatternSelecter>().lastTreeNumber;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (hasSpawned) return;
|
||||
if (hasSpawned || treeCount >= maxTrees) return;
|
||||
|
||||
Debug.Log("Player Y: " + player.position.y + " | Tree Y + 2: " + (transform.position.y + 2f));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user