Souljack/Assets/_Project/Scripts/LevelGenerating/RoomLightConfig.cs

36 lines
2.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
namespace _Project.Scripts.LevelGenerating
{
// =====================================================================
// Настройки освещения для темы комнаты.
// Создаётся в проекте: ПКМ -> Create -> Level -> Room Light Config.
// Позволяет спавнить готовый префаб (люстра, лампа) и гибко крутить его параметры.
// =====================================================================
[CreateAssetMenu(menuName = "Level/Room Light Config", fileName = "RoomLightConfig")]
public class RoomLightConfig : ScriptableObject
{
[Header("Префаб")]
[Tooltip("Префаб светильника (с мешем и Light). Если не задан — создастся обычный объект с Light.")]
public GameObject lightPrefab;
[Header("Размещение")]
[Tooltip("Расстояние между лампами в метрах: большая комната получает сетку ламп")]
[Min(0.5f)] public float spacing = 6f;
[Tooltip("На сколько метров ниже потолка висит точка спавна префаба (0 — вплотную к потолку)")]
public float ceilingDrop = 0f;
[Tooltip("Дополнительный поворот префаба (если моделька криво экспортирована)")]
public Vector3 rotationOffset = Vector3.zero;
[Header("Параметры источника света")]
[Tooltip("Если включено, параметры ниже перезапишут настройки компонента Light внутри префаба")]
public bool overrideLightParameters = true;
public Color color = Color.white;
[Min(0f)] public float intensity = 1.5f;
[Min(0.1f)] public float range = 8f;
public LightShadows shadows = LightShadows.None;
}
}