33 lines
884 B
C#
33 lines
884 B
C#
|
|
using UnityEngine;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 相机设置接口类,在GameWrapper程序集中定义
|
|||
|
|
/// 由Gameplay程序集实现具体的逻辑
|
|||
|
|
/// </summary>
|
|||
|
|
public interface ICameraSettings
|
|||
|
|
{
|
|||
|
|
bool UseOrthographicMode { get; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 默认的相机设置实现,仅在没有其他实现时使用
|
|||
|
|
/// </summary>
|
|||
|
|
public class DefaultCameraSettings : ICameraSettings
|
|||
|
|
{
|
|||
|
|
public bool UseOrthographicMode => false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 相机设置管理器 负责提供当前的相机特殊设置
|
|||
|
|
/// </summary>
|
|||
|
|
public static class CameraSettingsManager
|
|||
|
|
{
|
|||
|
|
private static ICameraSettings _currentSettings = new DefaultCameraSettings();
|
|||
|
|
|
|||
|
|
public static ICameraSettings CurrentSettings => _currentSettings;
|
|||
|
|
|
|||
|
|
public static void RegisterSettings(ICameraSettings settings)
|
|||
|
|
{
|
|||
|
|
_currentSettings = settings ?? new DefaultCameraSettings();
|
|||
|
|
}
|
|||
|
|
}
|