-начал функцию для подгонки комнаты под размеры
This commit is contained in:
parent
e84940b8fe
commit
6f0520f9a0
@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using _Project.Scripts.Utilities;
|
using _Project.Scripts.Utilities;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@ -14,5 +15,11 @@ namespace _Project.Scripts.LevelGenerating
|
|||||||
{
|
{
|
||||||
Rooms.Add(room);
|
Rooms.Add(room);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Room GetLastRoom()
|
||||||
|
{
|
||||||
|
// return Rooms[Rooms.Count - 1];
|
||||||
|
return Rooms.Last();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -18,9 +18,6 @@ namespace _Project.Scripts.LevelGenerating
|
|||||||
[SerializeField] private GameObject GameObjectA;
|
[SerializeField] private GameObject GameObjectA;
|
||||||
[SerializeField] private GameObject GameObjectB;
|
[SerializeField] private GameObject GameObjectB;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private int RoomCount;
|
private int RoomCount;
|
||||||
private LevelManager levelManager;
|
private LevelManager levelManager;
|
||||||
|
|
||||||
@ -141,6 +138,13 @@ namespace _Project.Scripts.LevelGenerating
|
|||||||
{
|
{
|
||||||
newRoom.isWallable = false;
|
newRoom.isWallable = false;
|
||||||
levelManager.AddRoom(newRoom);
|
levelManager.AddRoom(newRoom);
|
||||||
|
CreateCorridor(newRoom.Position,newRoom.Length,newRoom.Wigth,exitForCor);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newRoom.isWallable = true;
|
||||||
|
EditRoomFoFitting(newRoom,exitForCor);
|
||||||
|
levelManager.AddRoom(newRoom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -149,6 +153,15 @@ namespace _Project.Scripts.LevelGenerating
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EditRoomFoFitting(Room room)
|
||||||
|
{
|
||||||
|
if (room.Position.x + room.Length - lengthFloor <= 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool IsRoomCanFit(Vector2 vector2, ExitsInRoomType exitForCor)
|
private bool IsRoomCanFit(Vector2 vector2, ExitsInRoomType exitForCor)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user