feat: Enhance CameraZoneMigrationTool with rectilinear polygon reconstruction and fallback handling

- Implemented a new method for reconstructing rectilinear polygons from trigger points.
- Added a fallback mechanism using nearest neighbor ordering and 2-opt optimization for irregular shapes.
- Updated point sorting to ensure counter-clockwise orientation for polygon colliders.

fix: Suppress validation warnings during batch enemy placement in SceneObjectPlacerTool

- Introduced a static property in EnemyBase to suppress validation warnings during editor object placement.
- Updated SceneObjectPlacerTool to utilize this property when creating enemy game objects.

refactor: Clean up OnValidate method in EnemyBase to respect suppression flag

- Modified OnValidate to check for the suppression flag before logging warnings about missing configurations.
This commit is contained in:
2026-05-26 16:17:24 +08:00
parent 5a0f1548ea
commit 5ad6ed8ae6
5 changed files with 21876 additions and 20902 deletions

View File

@@ -710,8 +710,12 @@ namespace BaseGames.Enemies
}
#if UNITY_EDITOR
/// <summary>Set to true during batch editor placement to suppress mid-wiring OnValidate warnings.</summary>
public static bool SuppressValidationWarnings { get; set; }
protected virtual void OnValidate()
{
if (SuppressValidationWarnings) return;
if (_statsSO == null)
Debug.LogWarning($"[EnemyBase] {gameObject.name} 缺少 EnemyStatsSO 配置(运行时会 NullRef。", this);
if (_stats == null)