From e326069a8ddb8bce19652e2f192f64228d46cc68 Mon Sep 17 00:00:00 2001 From: Casey Date: Sun, 5 Feb 2023 19:15:24 +1100 Subject: [PATCH 1/3] MORE FABS --- Assets/Prefab/Tile_01_obstacle 1.prefab | 3 +++ Assets/Prefab/Tile_01_obstacle 1.prefab.meta | 7 +++++++ Assets/Prefab/Tile_02_obstacle 1.prefab | 3 +++ Assets/Prefab/Tile_02_obstacle 1.prefab.meta | 7 +++++++ 4 files changed, 20 insertions(+) create mode 100644 Assets/Prefab/Tile_01_obstacle 1.prefab create mode 100644 Assets/Prefab/Tile_01_obstacle 1.prefab.meta create mode 100644 Assets/Prefab/Tile_02_obstacle 1.prefab create mode 100644 Assets/Prefab/Tile_02_obstacle 1.prefab.meta diff --git a/Assets/Prefab/Tile_01_obstacle 1.prefab b/Assets/Prefab/Tile_01_obstacle 1.prefab new file mode 100644 index 0000000..0d90dd0 --- /dev/null +++ b/Assets/Prefab/Tile_01_obstacle 1.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6944f815fb45ffe376da8684d99ccb5d59bf7e21764b8dc65771fa44ac5db1c +size 24328 diff --git a/Assets/Prefab/Tile_01_obstacle 1.prefab.meta b/Assets/Prefab/Tile_01_obstacle 1.prefab.meta new file mode 100644 index 0000000..b4923e8 --- /dev/null +++ b/Assets/Prefab/Tile_01_obstacle 1.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cae8ccb1101be9644bb467f4ec9c13f2 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefab/Tile_02_obstacle 1.prefab b/Assets/Prefab/Tile_02_obstacle 1.prefab new file mode 100644 index 0000000..a5efe43 --- /dev/null +++ b/Assets/Prefab/Tile_02_obstacle 1.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14902aeb53d4e6549dc385f15f5925e72ee5060c1dedbffdd9e4003cd1a9ac91 +size 18580 diff --git a/Assets/Prefab/Tile_02_obstacle 1.prefab.meta b/Assets/Prefab/Tile_02_obstacle 1.prefab.meta new file mode 100644 index 0000000..b068a51 --- /dev/null +++ b/Assets/Prefab/Tile_02_obstacle 1.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 431e89a7d14485749b7ba6abb00ecbe3 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From 7a26f392273ff669148d13d841e951924c0b1d51 Mon Sep 17 00:00:00 2001 From: Joshua Date: Sun, 5 Feb 2023 19:16:19 +1100 Subject: [PATCH 2/3] final tile --- Assets/Data/Tiles/Final.asset | 3 +++ Assets/Data/Tiles/Final.asset.meta | 8 ++++++++ Assets/Prefab/FinalTile_01.prefab | 3 +++ Assets/Prefab/FinalTile_01.prefab.meta | 7 +++++++ Assets/Prefab/Freg_wRignDance.prefab | 3 +++ Assets/Prefab/Freg_wRignDance.prefab.meta | 7 +++++++ Assets/Scenes/Main.unity | 4 ++-- Assets/Scripts/Route/TileManager.cs | 24 ++++++++++++++++------- 8 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 Assets/Data/Tiles/Final.asset create mode 100644 Assets/Data/Tiles/Final.asset.meta create mode 100644 Assets/Prefab/FinalTile_01.prefab create mode 100644 Assets/Prefab/FinalTile_01.prefab.meta create mode 100644 Assets/Prefab/Freg_wRignDance.prefab create mode 100644 Assets/Prefab/Freg_wRignDance.prefab.meta diff --git a/Assets/Data/Tiles/Final.asset b/Assets/Data/Tiles/Final.asset new file mode 100644 index 0000000..b502a1a --- /dev/null +++ b/Assets/Data/Tiles/Final.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e20cb2f9f01751a8bd601227495bbea31dab2a7d18da53983f3fd0f22bd9751 +size 497 diff --git a/Assets/Data/Tiles/Final.asset.meta b/Assets/Data/Tiles/Final.asset.meta new file mode 100644 index 0000000..b94ca46 --- /dev/null +++ b/Assets/Data/Tiles/Final.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aa439551c5f028748be734246632e9e2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefab/FinalTile_01.prefab b/Assets/Prefab/FinalTile_01.prefab new file mode 100644 index 0000000..42b8edd --- /dev/null +++ b/Assets/Prefab/FinalTile_01.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:737b8fec1a5149afcc52f9e12c1d8eccaac17e4ec40089b40b5bfcbaaf620d47 +size 295968 diff --git a/Assets/Prefab/FinalTile_01.prefab.meta b/Assets/Prefab/FinalTile_01.prefab.meta new file mode 100644 index 0000000..7221fae --- /dev/null +++ b/Assets/Prefab/FinalTile_01.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1355850619fff884dbb97b93633e5a70 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefab/Freg_wRignDance.prefab b/Assets/Prefab/Freg_wRignDance.prefab new file mode 100644 index 0000000..6a439b2 --- /dev/null +++ b/Assets/Prefab/Freg_wRignDance.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7578333d062ee2049a42317c001ce8deec06a05a15f4560eae2f0f6a8c173f72 +size 62995 diff --git a/Assets/Prefab/Freg_wRignDance.prefab.meta b/Assets/Prefab/Freg_wRignDance.prefab.meta new file mode 100644 index 0000000..5f14325 --- /dev/null +++ b/Assets/Prefab/Freg_wRignDance.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3b9cec4f3f93f0245ae7b60bcdf4d150 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 29a2b04..cd51a65 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:846b79708e8bc05663504fcf3619d214a8ae4f1e380a9fb9049fb5084bc80568 -size 65091 +oid sha256:a2e303750b2ca3c5dbc150ccfcce0ac7338d3437cd3c07e269282cb458e4f505 +size 65193 diff --git a/Assets/Scripts/Route/TileManager.cs b/Assets/Scripts/Route/TileManager.cs index e1009b0..58675bd 100644 --- a/Assets/Scripts/Route/TileManager.cs +++ b/Assets/Scripts/Route/TileManager.cs @@ -10,6 +10,9 @@ public class TileManager : MonoBehaviour [SerializeField] private int trackTiles = 10; + [SerializeField] + private TileData m_finalTile; + private int m_bendProfile = 0; @@ -30,10 +33,10 @@ public class TileManager : MonoBehaviour for (int i = 0; i < trackTiles; i++) { - SpawnRandomTile(); + SpawnTile(); } - + SpawnTile(m_finalTile); } // Update is called once per frame @@ -58,16 +61,23 @@ public class TileManager : MonoBehaviour }*/ } - void SpawnRandomTile() + /// + /// Spawn next tile + /// + /// Leave null for random + void SpawnTile(TileData tileData = null) { var _startBendProfile = m_bendProfile; - TileData _selectedTile = new TileData(); + TileData _selectedTile = tileData; - do + if(_selectedTile == null) { - _selectedTile = m_tileList[Random.Range(0, m_tileList.Count - 1)]; + do + { + _selectedTile = m_tileList[Random.Range(0, m_tileList.Count - 1)]; + } + while (Mathf.Abs(m_bendProfile + (int)_selectedTile.tileType) >= 2); } - while (Mathf.Abs(m_bendProfile + (int)_selectedTile.tileType) >= 2); m_bendProfile += (int)_selectedTile.tileType; From c49769e3a20936e827e4297edca83951e88c38ae Mon Sep 17 00:00:00 2001 From: Joshua Date: Sun, 5 Feb 2023 19:26:18 +1100 Subject: [PATCH 3/3] Some tile data --- Assets/Data/Tiles/Bend_Left.asset | 3 --- Assets/Data/Tiles/Bend_Left_01.asset | 3 +++ .../{Bend_Left.asset.meta => Bend_Left_01.asset.meta} | 0 Assets/Data/Tiles/Bend_Left_02.asset | 3 +++ Assets/Data/Tiles/Bend_Left_02.asset.meta | 8 ++++++++ Assets/Data/Tiles/Straight_01.asset | 2 +- Assets/Data/Tiles/Straight_02.asset | 3 +++ Assets/Data/Tiles/Straight_02.asset.meta | 8 ++++++++ Assets/Scenes/Main.unity | 4 ++-- Assets/Scripts/Route/TileManager.cs | 2 +- 10 files changed, 29 insertions(+), 7 deletions(-) delete mode 100644 Assets/Data/Tiles/Bend_Left.asset create mode 100644 Assets/Data/Tiles/Bend_Left_01.asset rename Assets/Data/Tiles/{Bend_Left.asset.meta => Bend_Left_01.asset.meta} (100%) create mode 100644 Assets/Data/Tiles/Bend_Left_02.asset create mode 100644 Assets/Data/Tiles/Bend_Left_02.asset.meta create mode 100644 Assets/Data/Tiles/Straight_02.asset create mode 100644 Assets/Data/Tiles/Straight_02.asset.meta diff --git a/Assets/Data/Tiles/Bend_Left.asset b/Assets/Data/Tiles/Bend_Left.asset deleted file mode 100644 index 6584830..0000000 --- a/Assets/Data/Tiles/Bend_Left.asset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5d2827fd1d81a3700ba37186dcd7700fca664b589eb44a130061b1669c439f0f -size 502 diff --git a/Assets/Data/Tiles/Bend_Left_01.asset b/Assets/Data/Tiles/Bend_Left_01.asset new file mode 100644 index 0000000..69fb73e --- /dev/null +++ b/Assets/Data/Tiles/Bend_Left_01.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f078f1f5525c03b852a766c298a619546534527eb85a2eff1d3421de04624d3 +size 505 diff --git a/Assets/Data/Tiles/Bend_Left.asset.meta b/Assets/Data/Tiles/Bend_Left_01.asset.meta similarity index 100% rename from Assets/Data/Tiles/Bend_Left.asset.meta rename to Assets/Data/Tiles/Bend_Left_01.asset.meta diff --git a/Assets/Data/Tiles/Bend_Left_02.asset b/Assets/Data/Tiles/Bend_Left_02.asset new file mode 100644 index 0000000..53c7985 --- /dev/null +++ b/Assets/Data/Tiles/Bend_Left_02.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4b5786f658c575bede6e76c8eeb7c5e6ff83f688dfee3f83010a7e885aa1bb9 +size 505 diff --git a/Assets/Data/Tiles/Bend_Left_02.asset.meta b/Assets/Data/Tiles/Bend_Left_02.asset.meta new file mode 100644 index 0000000..01cbdc6 --- /dev/null +++ b/Assets/Data/Tiles/Bend_Left_02.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fcc2d51be6341b64b8709e5259b7b848 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Data/Tiles/Straight_01.asset b/Assets/Data/Tiles/Straight_01.asset index 646b968..97b92aa 100644 --- a/Assets/Data/Tiles/Straight_01.asset +++ b/Assets/Data/Tiles/Straight_01.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:36917b533f5f5abc01c79997c664649aa49661692510f886005f67313d8edae7 +oid sha256:86d4bebfbf84f9a871f041e93ea64381b49275abb65751668288bf9e0482bff7 size 503 diff --git a/Assets/Data/Tiles/Straight_02.asset b/Assets/Data/Tiles/Straight_02.asset new file mode 100644 index 0000000..8f56d9c --- /dev/null +++ b/Assets/Data/Tiles/Straight_02.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea27d5d41b4fb21f05ee18f081f12798d1aa17cd79932c34da203f3a42a73370 +size 503 diff --git a/Assets/Data/Tiles/Straight_02.asset.meta b/Assets/Data/Tiles/Straight_02.asset.meta new file mode 100644 index 0000000..a7d9926 --- /dev/null +++ b/Assets/Data/Tiles/Straight_02.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 27840c40339e676429a2e06442fbfe0d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index cd51a65..85ed0b2 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a2e303750b2ca3c5dbc150ccfcce0ac7338d3437cd3c07e269282cb458e4f505 -size 65193 +oid sha256:e0cc345bf817079df6b981b7cb4356f840adebcf6a295e63f3e86aeeaac6a644 +size 65336 diff --git a/Assets/Scripts/Route/TileManager.cs b/Assets/Scripts/Route/TileManager.cs index 58675bd..0b28105 100644 --- a/Assets/Scripts/Route/TileManager.cs +++ b/Assets/Scripts/Route/TileManager.cs @@ -84,7 +84,7 @@ public class TileManager : MonoBehaviour var _newTileObj = Instantiate(_selectedTile.prefab); _newTileObj.transform.forward = m_currentTile.exitAnchor.transform.forward; - var _newTileController = _newTileObj.GetComponent(); + var _newTileController = _newTileObj.GetComponentInChildren(); Vector3 _offset = m_currentTile.exitAnchor.position - _newTileController.entryAnchor.position; _newTileObj.transform.position += _offset;