nikola is a good man

This commit is contained in:
cemt1363
2026-06-07 07:30:04 +02:00
parent e250dd7d98
commit 9e486595f2
3 changed files with 21 additions and 9 deletions
+1 -2
View File
@@ -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 -2
View File
@@ -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));