调整Bloom
This commit is contained in:
@@ -57,16 +57,23 @@ namespace Ichni.RhythmGame
|
||||
gameCamera.orthographicSize = orthographicSize;
|
||||
gameCamera.cameraTransform = gameCamera.transform;
|
||||
|
||||
float ratioDifference = UIManager.GetScreenRatio() - UIManager.StandardRatio;
|
||||
if (ratioDifference > 0)
|
||||
float currentAspect = UIManager.GetScreenRatio();
|
||||
float targetAspect = UIManager.StandardRatio;
|
||||
|
||||
if (currentAspect < targetAspect)
|
||||
{
|
||||
//gameCamera.perspectiveOffset = 12.5f * ratioDifference;
|
||||
// 屏幕比较方 (如 4:3 平板),需要增加垂直 FOV 以保持 16:9 标准下的水平绝对视野
|
||||
float hFovRad = 2.0f * Mathf.Atan(Mathf.Tan(perspectiveAngle * Mathf.Deg2Rad / 2.0f) * targetAspect);
|
||||
float newVFovRad = 2.0f * Mathf.Atan(Mathf.Tan(hFovRad / 2.0f) / currentAspect);
|
||||
|
||||
// 设置 perspectiveOffset 以完美补足被裁切的空间
|
||||
gameCamera.perspectiveOffset = (newVFovRad * Mathf.Rad2Deg) - perspectiveAngle;
|
||||
}
|
||||
else
|
||||
{
|
||||
gameCamera.perspectiveOffset = -25f * ratioDifference;
|
||||
// 屏幕比较长 (如 20:9 手机),维持原有垂直 FOV,左右延展屏幕用于渲染环境背景
|
||||
gameCamera.perspectiveOffset = 0f;
|
||||
}
|
||||
|
||||
gameCamera.RefreshFOV();
|
||||
return gameCamera;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public abstract partial class GameElement : SerializedMonoBehaviour, IBaseElement, IComparable<GameElement>
|
||||
public abstract partial class GameElement : SerializedMonoBehaviour, IBaseElement, IComparable<GameElement>, IScheduledElement
|
||||
{
|
||||
#region [属性和标记] Essential & Tracking Info
|
||||
//物体名
|
||||
@@ -145,6 +145,19 @@ namespace Ichni.RhythmGame
|
||||
return HierarchyPriority.CompareTo(other.HierarchyPriority);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [调度更新] IScheduledElement Implementation
|
||||
/// <summary>
|
||||
/// 由 ElementUpdateScheduler 在对应阶段调用。
|
||||
/// 子类按需重写以实现特定阶段的更新逻辑。
|
||||
/// </summary>
|
||||
public virtual void ScheduledUpdate(UpdatePhase phase, float songTime) { }
|
||||
|
||||
/// <summary>
|
||||
/// 元素是否处于活跃状态。调度器跳过非活跃元素以节省开销。
|
||||
/// </summary>
|
||||
public virtual bool IsScheduledActive => isActiveAndEnabled;
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region [额外交互及存档重写预留] Editor Interaction & Interfaces Overrides
|
||||
|
||||
Reference in New Issue
Block a user