diff --git a/Assets/Data/Tiles/Bend_Left.asset b/Assets/Data/Tiles/Bend_Left.asset new file mode 100644 index 0000000..6584830 --- /dev/null +++ b/Assets/Data/Tiles/Bend_Left.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d2827fd1d81a3700ba37186dcd7700fca664b589eb44a130061b1669c439f0f +size 502 diff --git a/Assets/Data/Tiles/Bend_Left.asset.meta b/Assets/Data/Tiles/Bend_Left.asset.meta new file mode 100644 index 0000000..60957a0 --- /dev/null +++ b/Assets/Data/Tiles/Bend_Left.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e73daafd87f356a418683d515f657f1e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Data/Tiles/Bend_Right.asset b/Assets/Data/Tiles/Bend_Right.asset new file mode 100644 index 0000000..1f2878d --- /dev/null +++ b/Assets/Data/Tiles/Bend_Right.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ddacc12ccd68acdd806c5170abbe70beb9df51cc458aeff966044fd09d0dcb82 +size 502 diff --git a/Assets/Data/Tiles/Bend_Right.asset.meta b/Assets/Data/Tiles/Bend_Right.asset.meta new file mode 100644 index 0000000..7d2bf78 --- /dev/null +++ b/Assets/Data/Tiles/Bend_Right.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5596d3ad400eb0f4a96bcfd82701418e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefab/Tile_01.prefab b/Assets/Prefab/Tile_01.prefab index a5ce91e..efae9a6 100644 --- a/Assets/Prefab/Tile_01.prefab +++ b/Assets/Prefab/Tile_01.prefab @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e27467cb33014f882a008a759a1db145beb2163354f1c8a147b943359f24a705 -size 117059 +oid sha256:83dab69bb36ee087cf4b75336d8fe4f72a2e437105ca62c37768b933501a3df2 +size 118408 diff --git a/Assets/Prefab/Tile_02.prefab b/Assets/Prefab/Tile_02.prefab new file mode 100644 index 0000000..f787b31 --- /dev/null +++ b/Assets/Prefab/Tile_02.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0363bb2cd369e225499e8848f5ecacc56c48f85ce36c1e80384458b52cb08070 +size 118434 diff --git a/Assets/Prefab/Tile_02.prefab.meta b/Assets/Prefab/Tile_02.prefab.meta new file mode 100644 index 0000000..3e9dffa --- /dev/null +++ b/Assets/Prefab/Tile_02.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: aee91d9e9e533ae48a241c35e7d37e4b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefab/Tile_03.prefab b/Assets/Prefab/Tile_03.prefab new file mode 100644 index 0000000..d4d767b --- /dev/null +++ b/Assets/Prefab/Tile_03.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ae93f30d9683bb4b3d873033f8dd7922aea4815649cf0193459fe33b81c4286 +size 118419 diff --git a/Assets/Prefab/Tile_03.prefab.meta b/Assets/Prefab/Tile_03.prefab.meta new file mode 100644 index 0000000..b847d86 --- /dev/null +++ b/Assets/Prefab/Tile_03.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9963b2a917f0e6946a7f8a8eecd0a128 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 6e044b3..19541f0 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6c6e076f5f8c359cb63233e7fd5b710bf5d8fbd1aba65ec52001df11dcbb504d -size 22446 +oid sha256:164cb4dde3982f204651037fa4427915771c830c9c0a6f20af3353a9c69475cd +size 24771 diff --git a/Assets/Scripts/Route/TileController.cs b/Assets/Scripts/Route/TileController.cs index 70e945e..6f19de1 100644 --- a/Assets/Scripts/Route/TileController.cs +++ b/Assets/Scripts/Route/TileController.cs @@ -8,6 +8,12 @@ public class TileController : MonoBehaviour public Transform exitAnchor; - - + private void OnTriggerExit(Collider other) + { + if(other.transform.Equals(Camera.main.transform)) + { + Destroy(gameObject, 1f); + } + } + } diff --git a/Assets/Scripts/Route/TileManager.cs b/Assets/Scripts/Route/TileManager.cs index 833cebd..dc661c7 100644 --- a/Assets/Scripts/Route/TileManager.cs +++ b/Assets/Scripts/Route/TileManager.cs @@ -10,9 +10,6 @@ public class TileManager : MonoBehaviour [SerializeField] private Transform m_camTransform; - [SerializeField] - private float m_exitCullDistance = 3f; - private int m_bendProfile = 0; private TileController m_previousTile; @@ -34,7 +31,9 @@ public class TileManager : MonoBehaviour // Update is called once per frame void Update() { - if(m_previousTile != null) + + /* + if (m_previousTile != null) { if (Vector3.Distance(m_previousTile.transform.position, Camera.main.transform.position) > m_exitCullDistance) { @@ -42,6 +41,7 @@ public class TileManager : MonoBehaviour m_previousTile = null; } } + */ if(Input.GetKeyDown(KeyCode.Space)) { @@ -58,17 +58,20 @@ public class TileManager : MonoBehaviour { _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.transform.forward; + _newTileObj.transform.forward = m_currentTile.exitAnchor.transform.forward; var _newTileController = _newTileObj.GetComponent(); Vector3 _offset = m_currentTile.exitAnchor.position - _newTileController.entryAnchor.position; _newTileObj.transform.position += _offset; + + m_previousTile = m_currentTile; + m_currentTile = _newTileController; } }