diff --git a/MrBigsock/Assets/Code/FollowPlayer.cs b/MrBigsock/Assets/Code/FollowPlayer.cs index 6f178e01850ac03da8d9eb4807a5fa1507a04488..c8d28c93ca321fb663a5e7505c9c34ed357b3d6d 100644 --- a/MrBigsock/Assets/Code/FollowPlayer.cs +++ b/MrBigsock/Assets/Code/FollowPlayer.cs @@ -15,18 +15,33 @@ namespace Bigsock [SerializeField] private CinemachineConfiner2D cameraMap; + private int levels = 1; + + Vector3 offset = new Vector3(0, 0, -10); int i = 0; + GameObject[] boss; + GameObject player; + GameObject door; void Start() { neighborMapGenerator.RunProceduralGeneration(); - + player = GameObject.Find("BigSock"); } void LateUpdate() { + boss = GameObject.FindGameObjectsWithTag("Boss"); + + + if (boss.Length == 0 && levels <= 1) + { + neighborMapGenerator.RunProceduralGeneration(); + player.transform.position = new Vector3(9, 5, 0); + levels++; + } int i = 0; if(i == 0) { cameraMap.InvalidateCache();