From 91df216e3df423c35bc3476783f9d5f00012a49c Mon Sep 17 00:00:00 2001 From: Daniel Koch Date: Wed, 5 Feb 2020 17:52:44 +0200 Subject: [PATCH 1/3] small fixes --- Assets/Scripts/LevelController.cs | 6 ++++-- Assets/Scripts/PlayerController.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/LevelController.cs b/Assets/Scripts/LevelController.cs index f01b3d2..509b57a 100644 --- a/Assets/Scripts/LevelController.cs +++ b/Assets/Scripts/LevelController.cs @@ -40,9 +40,10 @@ public void GenerateNext() float nextSpawnZ = spawnPosition.position.z; float nextSpawnX = spawnPosition.position.x; FloorInfo floorInfo; - for (int i = 0; i < depth; i++) + GameObject prefab = (GameObject)Resources.Load("Prefabs/Floor1", typeof(GameObject)); + int i = 0; + for (; i < depth; i++) { - GameObject prefab = (GameObject)Resources.Load("Prefabs/Floor1", typeof(GameObject)); nextLevel = Instantiate(prefab, new Vector3(nextSpawnX, -YDISTANCE * (i + 1), nextSpawnZ), prefab.transform.rotation); floorInfo = nextLevel.GetComponent(); int direction = random.Next(1, 4); @@ -67,6 +68,7 @@ public void GenerateNext() floorInfo.DoorWest.SetActive(false); } } + nextLevel = Instantiate(prefab, new Vector3(nextSpawnX, -YDISTANCE * (i + 1), nextSpawnZ), prefab.transform.rotation); } void Awake() diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index 9e124d6..d791814 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -21,7 +21,7 @@ void Start() } // Update is called once per frame - void FixedUpdate() + void Update() { ApplyMovement(); if (!isAttacking) From 848c08fa5712dea3fd25b75ebfb6c5c79c4342d7 Mon Sep 17 00:00:00 2001 From: Daniel Koch Date: Wed, 5 Feb 2020 17:59:13 +0200 Subject: [PATCH 2/3] fix camera --- Assets/Scripts/CameraController.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Assets/Scripts/CameraController.cs b/Assets/Scripts/CameraController.cs index 9a89c51..ba88ebb 100644 --- a/Assets/Scripts/CameraController.cs +++ b/Assets/Scripts/CameraController.cs @@ -34,12 +34,7 @@ public void SetFollowedPlayer(GameObject player) transform.position = player.transform.position - (Distance * direction); }; } - - void Awake() - { - this.SetFollowedPlayer(gameObject); - } - + void LateUpdate() { updateStrategy(); From 27a63a1b17ba5a81cb70b35693a2791518a2b999 Mon Sep 17 00:00:00 2001 From: Daniel Koch Date: Wed, 5 Feb 2020 18:01:18 +0200 Subject: [PATCH 3/3] FIX stylelint >:( --- Assets/Scripts/LevelController.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Assets/Scripts/LevelController.cs b/Assets/Scripts/LevelController.cs index 509b57a..a7f78f1 100644 --- a/Assets/Scripts/LevelController.cs +++ b/Assets/Scripts/LevelController.cs @@ -68,6 +68,7 @@ public void GenerateNext() floorInfo.DoorWest.SetActive(false); } } + nextLevel = Instantiate(prefab, new Vector3(nextSpawnX, -YDISTANCE * (i + 1), nextSpawnZ), prefab.transform.rotation); }