Add JumpPad feature with prefab and adapter implementation
This commit is contained in:
@@ -9,6 +9,7 @@ namespace Infrastructure.Unity
|
||||
[Header("Prefabs")]
|
||||
[SerializeField] private TileViewAdapter tilePrefab;
|
||||
[SerializeField] private ParticleSystem tileBreakVfxPrefab;
|
||||
[SerializeField] private JumpPadAdapter jumpPadPrefab;
|
||||
|
||||
[Header("Settings")]
|
||||
[SerializeField] private int gridSizeX = 10;
|
||||
@@ -44,6 +45,14 @@ namespace Infrastructure.Unity
|
||||
var pos = new Vector3(coord.x - xOffset, yOffset, coord.y - zOffset);
|
||||
CreateTile(pos, $"{floorIndex}_{coord.x}_{coord.y}", floorIndex, soundManager, allTiles, tileViews);
|
||||
}
|
||||
|
||||
if (floorIndex > 0 && jumpPadPrefab)
|
||||
{
|
||||
var validSpot = coordinates[Random.Range(0, coordinates.Count)];
|
||||
var padPos = new Vector3(validSpot.x - xOffset, yOffset + 0.6f, validSpot.y - zOffset);
|
||||
|
||||
Instantiate(jumpPadPrefab, padPos, Quaternion.identity, transform);
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateTile(Vector3 position, string id, int floorIndex, SoundManager soundManager,
|
||||
|
||||
Reference in New Issue
Block a user