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/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/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/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/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:
diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity
index 29a2b04..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:846b79708e8bc05663504fcf3619d214a8ae4f1e380a9fb9049fb5084bc80568
-size 65091
+oid sha256:e0cc345bf817079df6b981b7cb4356f840adebcf6a295e63f3e86aeeaac6a644
+size 65336
diff --git a/Assets/Scripts/Route/TileManager.cs b/Assets/Scripts/Route/TileManager.cs
index e1009b0..0b28105 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,23 +61,30 @@ 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;
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;