Resolved merge conflicts

This commit is contained in:
go38coz
2026-06-06 15:01:32 +02:00
26 changed files with 2126 additions and 35 deletions
+16
View File
@@ -0,0 +1,16 @@
using UnityEngine;
public class SceneController : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: bbf8ab4673d6bf447aab098a12320431
+14 -10
View File
@@ -9,19 +9,23 @@ public class TreeSpawner : MonoBehaviour
void Update()
{
// Debug.Log("TreeSpawner running");
if (hasSpawned) return;
if (player.position.y < transform.position.y - 3f)
if (hasSpawned == false)
{
hasSpawned = true;
if (player.position.y < transform.position.y - 3f)
{
hasSpawned = true;
float treeHeight = GetComponent<SpriteRenderer>().bounds.size.y;
Vector3 spawnPos = (transform.position + Vector3.down * treeHeight) - new Vector3(0,-0.2f,0);
float treeHeight = GetComponent<SpriteRenderer>().bounds.size.y;
Vector3 spawnPos = transform.position + Vector3.down * treeHeight + new Vector3(0, 0.2f, 0);
Instantiate(treePrefab, spawnPos, Quaternion.identity);
Instantiate(treePrefab, spawnPos, Quaternion.identity);
}
}
// Delete trees that are far above the player
if (player.position.y < transform.position.y - 40f)
{
Destroy(gameObject);
}
}
}