игрок спанится в стартовой комнате, полу назначается уровень, тема комнате назначается

This commit is contained in:
vladislove committed 2026-10-12 20:20:05 +03:00
1 parent bf675c75e2
commit d05e6d8cf3
9 files changed
+78 -73

No files matched your search

@@ -5,13 +5,6 @@ using UnityEngine;
namespace _Project.Scripts.LevelGenerating
{
[Serializable]
public class ThemeEntry
{
public RoomType type;
public RoomTheme theme;
}
// =====================================================================
// Для каждой комнаты выбирает тему (по роли комнаты) и генератор, затем запускает его.
//
@@ -64,7 +64,9 @@ namespace _Project.Scripts.LevelGenerating
// пол: нормаль вверх
var floorGo = Make(roomGo.transform, "Floor", new Vector3(c.x, 0f, c.z),
Quaternion.identity, scale, true);
floorGo.layer = LayerMask.NameToLayer("Ground");
view.FloorRenderers.AddRange(floorGo.GetComponentsInChildren<Renderer>());
// потолок: перевёрнут, нормаль вниз
var ceilingGo = Make(roomGo.transform, "Ceiling", new Vector3(c.x, wallHeight, c.z),
@@ -0,0 +1,11 @@
using System;
namespace _Project.Scripts.LevelGenerating
{
[Serializable]
public class ThemeEntry
{
public RoomType type;
public RoomTheme theme;
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 45f74fba298244fbaa55961a1a2fcd3d
timeCreated: 1791823708
@@ -31,6 +31,7 @@ namespace _Project.Scripts.LevelGenerating
[SerializeField] private float _minDistanceStartLift; // метры
[SerializeField] private GameObject GameObjectA;
[SerializeField] private GameObject GameObjectB;
[SerializeField] private GameObject Player;
[SerializeField] private ShellSpawner shellSpawner; // если назначен, строит пол, стены и потолок
[SerializeField] private RoomGeneratorRegistry roomGenerators; // оформляет комнаты по темам (материалы, свет)
@@ -63,9 +64,11 @@ namespace _Project.Scripts.LevelGenerating
private static readonly RoomType[] FullRoles = { RoomType.Storage, RoomType.SwitchboardRoom, RoomType.BoilerRoom };
void Start()
{
{
ReadSettings();
Generate(0); // позже этим будет управлять оркестратор
var data = Generate(0); // позже этим будет управлять оркестратор
var pos = data.Start.Center;
Player.transform.position = new Vector3(pos.x/2f, 10, pos.y/2f);
}
void ReadSettings()