Slide 34
Slide 34 text
༻͢Δ෦ͷબ ؆ུԽͨ͠ͷ
private List BuildRoomsProperties(int count)
{
// ෦ͷScriptableObjectΛશ෦औΔ
var properties = Resources.LoadAll("Rooms").ToList();
// ඞཁͳ෦ଐੑΛఆٛ
RoomType[] requiredRoomType = { RoomType.Start,
RoomType.Locker,
RoomType.Timecard,
RoomType.President,
RoomType.Exit,
RoomType.Goal };
// ༨ΓHubଐੑͰຒΊΔ
List hubs = Enumerable.Repeat(RoomType.Hub, count - requiredRoomType.Length).ToList();
// Α͠ͳʹϥϯμϜʹऔΓग़ͯ͠ฦ͢
return hubs.AddRange(requiredRoomType.ToList())
.Select(t => GetRandomRoomProperty(properties, t))
.ToList();
}