diff --git a/Game/Assets/Prefabs/ObstaclePreFabs/RealBranch 1.prefab b/Game/Assets/Prefabs/ObstaclePreFabs/RealBranch 1.prefab index 1612496..d23c81a 100644 --- a/Game/Assets/Prefabs/ObstaclePreFabs/RealBranch 1.prefab +++ b/Game/Assets/Prefabs/ObstaclePreFabs/RealBranch 1.prefab @@ -127,7 +127,7 @@ BoxCollider2D: m_UsedByEffector: 1 m_CompositeOperation: 0 m_CompositeOrder: 0 - m_Offset: {x: 0, y: -0.61813337} + m_Offset: {x: 0, y: -0.299548} m_SpriteTilingProperty: border: {x: 0, y: 0, z: 0, w: 0} pivot: {x: 0.5, y: 0.5} @@ -137,7 +137,7 @@ BoxCollider2D: drawMode: 0 adaptiveTiling: 0 m_AutoTiling: 0 - m_Size: {x: 6.08, y: 1.5346009} + m_Size: {x: 6.08, y: 0.8974301} m_EdgeRadius: 0 --- !u!251 &1230605949537068183 PlatformEffector2D: diff --git a/Game/Assets/Prefabs/ObstaclePreFabs/RealBranch.prefab b/Game/Assets/Prefabs/ObstaclePreFabs/RealBranch.prefab index 77d19e6..2ed227b 100644 --- a/Game/Assets/Prefabs/ObstaclePreFabs/RealBranch.prefab +++ b/Game/Assets/Prefabs/ObstaclePreFabs/RealBranch.prefab @@ -127,7 +127,7 @@ BoxCollider2D: m_UsedByEffector: 1 m_CompositeOperation: 0 m_CompositeOrder: 0 - m_Offset: {x: 0, y: -0.61813337} + m_Offset: {x: 0, y: -0.25666255} m_SpriteTilingProperty: border: {x: 0, y: 0, z: 0, w: 0} pivot: {x: 0.5, y: 0.5} @@ -137,7 +137,7 @@ BoxCollider2D: drawMode: 0 adaptiveTiling: 0 m_AutoTiling: 0 - m_Size: {x: 6.08, y: 1.5346009} + m_Size: {x: 6.08, y: 0.8116592} m_EdgeRadius: 0 --- !u!251 &1230605949537068183 PlatformEffector2D: diff --git a/Game/Assets/Scripts/PatternSelecter.cs b/Game/Assets/Scripts/PatternSelecter.cs index 909f47b..12f93d3 100644 --- a/Game/Assets/Scripts/PatternSelecter.cs +++ b/Game/Assets/Scripts/PatternSelecter.cs @@ -2,24 +2,21 @@ using UnityEngine; public class PatternSelecter : MonoBehaviour { - - - bool isStarting = true; void Start() { - - if (isStarting) + foreach (Transform child in transform) { - transform.GetChild(0).gameObject.SetActive(true); - } else - { - foreach (Transform child in transform) - child.gameObject.SetActive(false); - - int randomIndex = Random.Range(1, transform.childCount); - - transform.GetChild(randomIndex).gameObject.SetActive(true); + child.gameObject.SetActive(false); } + if (TreeSpawner.treeCount == 0) + { + transform.GetChild(0).gameObject.SetActive(true); + } + else + { + int randomIndex = Random.Range(1, transform.childCount); + transform.GetChild(randomIndex).gameObject.SetActive(true); + } } } \ No newline at end of file diff --git a/Game/Assets/Scripts/TreeSpawner.cs b/Game/Assets/Scripts/TreeSpawner.cs index 0bd48a2..3eedbe7 100644 --- a/Game/Assets/Scripts/TreeSpawner.cs +++ b/Game/Assets/Scripts/TreeSpawner.cs @@ -7,6 +7,9 @@ public class TreeSpawner : MonoBehaviour private bool hasSpawned = false; + public static int treeCount; + + void Update() { if (hasSpawned == false) @@ -18,7 +21,9 @@ public class TreeSpawner : MonoBehaviour float treeHeight = GetComponent().bounds.size.y; Vector3 spawnPos = transform.position + Vector3.down * treeHeight + new Vector3(0, 0.2f, 0); + treeCount++; Instantiate(treePrefab, spawnPos, Quaternion.identity); + } }