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:
@@ -389,7 +389,7 @@ namespace BaseGames.Editor
|
||||
var report = new List<string>();
|
||||
int undoGroup = Undo.GetCurrentGroup();
|
||||
Undo.SetCurrentGroupName("Place E001 草蛭");
|
||||
|
||||
EnemyBase.SuppressValidationWarnings = true;
|
||||
GameObject go = new GameObject("ENM_CaoZhi");
|
||||
Undo.RegisterCreatedObjectUndo(go, "Place E001");
|
||||
go.transform.position = GetDropPosition();
|
||||
@@ -470,6 +470,7 @@ namespace BaseGames.Editor
|
||||
|
||||
Undo.CollapseUndoOperations(undoGroup);
|
||||
Selection.activeGameObject = go;
|
||||
EnemyBase.SuppressValidationWarnings = false;
|
||||
MarkDirtyAndLog("E001 草蛭", go, report);
|
||||
}
|
||||
|
||||
@@ -479,7 +480,7 @@ namespace BaseGames.Editor
|
||||
var report = new List<string>();
|
||||
int undoGroup = Undo.GetCurrentGroup();
|
||||
Undo.SetCurrentGroupName("Place E002 簧蛭");
|
||||
|
||||
EnemyBase.SuppressValidationWarnings = true;
|
||||
GameObject go = new GameObject("ENM_HuangZhi");
|
||||
Undo.RegisterCreatedObjectUndo(go, "Place E002");
|
||||
go.transform.position = GetDropPosition();
|
||||
@@ -548,6 +549,7 @@ namespace BaseGames.Editor
|
||||
|
||||
Undo.CollapseUndoOperations(undoGroup);
|
||||
Selection.activeGameObject = go;
|
||||
EnemyBase.SuppressValidationWarnings = false;
|
||||
MarkDirtyAndLog("E002 簧蛭", go, report);
|
||||
}
|
||||
|
||||
@@ -557,7 +559,7 @@ namespace BaseGames.Editor
|
||||
var report = new List<string>();
|
||||
int undoGroup = Undo.GetCurrentGroup();
|
||||
Undo.SetCurrentGroupName("Place E003 幼蛭");
|
||||
|
||||
EnemyBase.SuppressValidationWarnings = true;
|
||||
GameObject go = new GameObject("ENM_YouZhi");
|
||||
Undo.RegisterCreatedObjectUndo(go, "Place E003");
|
||||
go.transform.position = GetDropPosition();
|
||||
@@ -631,6 +633,7 @@ namespace BaseGames.Editor
|
||||
|
||||
Undo.CollapseUndoOperations(undoGroup);
|
||||
Selection.activeGameObject = go;
|
||||
EnemyBase.SuppressValidationWarnings = false;
|
||||
MarkDirtyAndLog("E003 幼蛭", go, report);
|
||||
}
|
||||
|
||||
@@ -640,7 +643,7 @@ namespace BaseGames.Editor
|
||||
var report = new List<string>();
|
||||
int undoGroup = Undo.GetCurrentGroup();
|
||||
Undo.SetCurrentGroupName("Place E004 蛭母");
|
||||
|
||||
EnemyBase.SuppressValidationWarnings = true;
|
||||
GameObject go = new GameObject("ENM_ZhiMu");
|
||||
Undo.RegisterCreatedObjectUndo(go, "Place E004");
|
||||
go.transform.position = GetDropPosition();
|
||||
@@ -757,6 +760,7 @@ namespace BaseGames.Editor
|
||||
|
||||
Undo.CollapseUndoOperations(undoGroup);
|
||||
Selection.activeGameObject = go;
|
||||
EnemyBase.SuppressValidationWarnings = false;
|
||||
MarkDirtyAndLog("E004 蛭母", go, report);
|
||||
}
|
||||
|
||||
@@ -766,7 +770,7 @@ namespace BaseGames.Editor
|
||||
var report = new List<string>();
|
||||
int undoGroup = Undo.GetCurrentGroup();
|
||||
Undo.SetCurrentGroupName("Place E005 肥蛭");
|
||||
|
||||
EnemyBase.SuppressValidationWarnings = true;
|
||||
GameObject go = new GameObject("ENM_FeiZhi");
|
||||
Undo.RegisterCreatedObjectUndo(go, "Place E005");
|
||||
go.transform.position = GetDropPosition();
|
||||
@@ -849,6 +853,7 @@ namespace BaseGames.Editor
|
||||
|
||||
Undo.CollapseUndoOperations(undoGroup);
|
||||
Selection.activeGameObject = go;
|
||||
EnemyBase.SuppressValidationWarnings = false;
|
||||
MarkDirtyAndLog("E005 肥蛭", go, report);
|
||||
}
|
||||
|
||||
@@ -858,7 +863,7 @@ namespace BaseGames.Editor
|
||||
var report = new List<string>();
|
||||
int undoGroup = Undo.GetCurrentGroup();
|
||||
Undo.SetCurrentGroupName("Place E006 讙");
|
||||
|
||||
EnemyBase.SuppressValidationWarnings = true;
|
||||
GameObject go = new GameObject("ENM_Huan");
|
||||
Undo.RegisterCreatedObjectUndo(go, "Place E006");
|
||||
go.transform.position = GetDropPosition();
|
||||
@@ -951,6 +956,7 @@ namespace BaseGames.Editor
|
||||
|
||||
Undo.CollapseUndoOperations(undoGroup);
|
||||
Selection.activeGameObject = go;
|
||||
EnemyBase.SuppressValidationWarnings = false;
|
||||
MarkDirtyAndLog("E006 讙", go, report);
|
||||
}
|
||||
|
||||
@@ -960,7 +966,7 @@ namespace BaseGames.Editor
|
||||
var report = new List<string>();
|
||||
int undoGroup = Undo.GetCurrentGroup();
|
||||
Undo.SetCurrentGroupName("Place Boss 嘲风");
|
||||
|
||||
EnemyBase.SuppressValidationWarnings = true;
|
||||
GameObject go = new GameObject("ENM_ChaoFeng");
|
||||
Undo.RegisterCreatedObjectUndo(go, "Place ChaoFeng");
|
||||
go.transform.position = GetDropPosition();
|
||||
@@ -1067,6 +1073,7 @@ namespace BaseGames.Editor
|
||||
|
||||
Undo.CollapseUndoOperations(undoGroup);
|
||||
Selection.activeGameObject = go;
|
||||
EnemyBase.SuppressValidationWarnings = false;
|
||||
MarkDirtyAndLog("Boss 嘲风 (ChaoFeng)", go, report);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user