From ae12fa33c81980c8673af3b728b232d860f278ec Mon Sep 17 00:00:00 2001 From: Joshua Reason Date: Fri, 18 Oct 2019 23:22:56 +1100 Subject: [PATCH] fixed rotate converoy belt section --- Assets/Prefabs/Traps/Turntable L with Cube.prefab | 2 +- Assets/Prefabs/Traps/Turntable R with Cube.prefab | 2 +- Assets/Scripts/Map Generation/MapManager.cs | 6 +++++- ProjectSettings/EditorBuildSettings.asset | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Assets/Prefabs/Traps/Turntable L with Cube.prefab b/Assets/Prefabs/Traps/Turntable L with Cube.prefab index 878b436..632323c 100644 --- a/Assets/Prefabs/Traps/Turntable L with Cube.prefab +++ b/Assets/Prefabs/Traps/Turntable L with Cube.prefab @@ -106,7 +106,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 6692f0c965cb4fa41b616ba0991653a3, type: 3} m_Name: m_EditorClassIdentifier: - VisualOffset: {x: 0, y: 0, z: 0} + VisualOffset: {x: 0, y: 0.5, z: 0} is_Walkable: 1 isWater: 0 isPit: 0 diff --git a/Assets/Prefabs/Traps/Turntable R with Cube.prefab b/Assets/Prefabs/Traps/Turntable R with Cube.prefab index a811f9a..48b3d63 100644 --- a/Assets/Prefabs/Traps/Turntable R with Cube.prefab +++ b/Assets/Prefabs/Traps/Turntable R with Cube.prefab @@ -106,7 +106,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 6692f0c965cb4fa41b616ba0991653a3, type: 3} m_Name: m_EditorClassIdentifier: - VisualOffset: {x: 0, y: 0, z: 0} + VisualOffset: {x: 0, y: 0.5, z: 0} is_Walkable: 1 isWater: 0 isPit: 0 diff --git a/Assets/Scripts/Map Generation/MapManager.cs b/Assets/Scripts/Map Generation/MapManager.cs index 222cb4e..03c8144 100644 --- a/Assets/Scripts/Map Generation/MapManager.cs +++ b/Assets/Scripts/Map Generation/MapManager.cs @@ -157,7 +157,11 @@ public class MapManager : ScriptableObject } } //Having generated our list, we choose a random segment from it - MapSection nextSection = validSections[(int)Random.Range(0.0f, (float)validSections.Count)]; + int selectedIndex = Random.Range(0, validSections.Count); + Debug.Log("Validmap sections: " + validSections.Count); + Debug.Log("Selected section: " + selectedIndex); + + MapSection nextSection = validSections[selectedIndex]; addSection(nextSection); } diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index b10b36b..a06026b 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a72b13def7e59eb6657bef59ecf1d9070ed89092b177a371d09e6b99b8e0f05c +oid sha256:89626e954c478d28ed17bbfc46452669c9cb4d5ced3c8e3e886ed6191cf54b15 size 1383