Test Animací - fail
This commit is contained in:
@@ -45,6 +45,7 @@ public class MapGenManager : MonoBehaviour
|
||||
GameObject startPoint = Instantiate(StartPoint, startPos, Quaternion.identity, transform);
|
||||
roomPositions.Add(startPos);
|
||||
placedRooms.Add(startPoint);
|
||||
startPoint.GetComponent<CreateEntrances>().SetEntrances(false, false, true, false);
|
||||
|
||||
// Instantiate the player at the starting position
|
||||
GameObject player = Instantiate(Player, new Vector3(startPos.x, 1, startPos.z), Quaternion.identity, transform);
|
||||
@@ -60,12 +61,14 @@ public class MapGenManager : MonoBehaviour
|
||||
GameObject room = Instantiate(roomPrefab, roomPos, Quaternion.identity, transform);
|
||||
placedRooms.Add(room);
|
||||
roomPositions.Add(roomPos);
|
||||
room.GetComponent<CreateEntrances>().SetEntrances(false, false, true, true);
|
||||
}
|
||||
|
||||
// Add End Point
|
||||
GameObject endPoint = Instantiate(EndPoint, GetGridPosition(EndPoint), Quaternion.identity, transform);
|
||||
roomPositions.Add(endPoint.transform.position);
|
||||
placedRooms.Add(endPoint);
|
||||
endPoint.GetComponent<CreateEntrances>().SetEntrances(false, false, false, false);
|
||||
|
||||
// Create corridors between rooms
|
||||
for (int i = 0; i < roomPositions.Count - 1; i++)
|
||||
@@ -96,7 +99,7 @@ public class MapGenManager : MonoBehaviour
|
||||
|
||||
Vector3 roomPos = new Vector3(
|
||||
lastRoomPos.x,
|
||||
lastRoomPos.y,
|
||||
lastRoomPos.y - 0.01f,
|
||||
lastRoomPos.z + lastRoom.prefabSize.y / 2f + roomSize.prefabSize.y / 2f + RoomDistance
|
||||
);
|
||||
|
||||
@@ -126,11 +129,12 @@ public class MapGenManager : MonoBehaviour
|
||||
);
|
||||
Quaternion doorRotation = Quaternion.Euler(0, 0, 0);
|
||||
GameObject doorCorridor = Instantiate(DoorCorridor, doorPos, doorRotation, transform);
|
||||
doorCorridor.GetComponent<DoorController>().OpenDoor();
|
||||
|
||||
|
||||
for (int i = 1; i < corridorCount; i++)
|
||||
{
|
||||
if(i % 2 != 0)
|
||||
if (i % 2 != 0)
|
||||
{
|
||||
// Create straight corridor
|
||||
Vector3 pos = new Vector3(
|
||||
|
||||
Reference in New Issue
Block a user