Files
Pal3.Unity/Assets/Scripts/Engine/Extensions/UnityObjectExtensions.cs
T
Jiaqi Liu 4cabbd03a7 Implement native PAL3/PAL3A effects and editing tools (#93)
* Implement original PAL3 effects and editor with formatting checks

* Add native PAL3A effect playback and SPar diagnostics

Enable shared playback for supported PAL3A groups with POL models, model opacity, and explosive geometry. Parse SPar resources for complete dependency diagnostics while retaining whole-group private fallback for pending simulation.

Preserve the last effect position when actors are missing or removed in both games, and keep actor-specific shape changes and private fallback guarded. Expand the editor and viewer to both variants and fix opaque alpha for RGB TGA textures.

Validation: PAL3/PAL3A effect suites 54/54 each; general regressions 278/278 and 295/295. Both-variant formatting and diff checks passed.

* Implement native SPar playback and PAL3A transport effects

Add SPar emitter simulation, native blending and billboard rendering for the
remaining 26 script/scene groups. Restore PAL3A transport geometry and seven
styles in game, the editor and ResourceViewer.

Preserve native live-state initial-frame behavior and mark the runtime UV
table non-serialized. Update the README and add format, playback, geometry
and resource-lifetime regression coverage.

Validation: targeted tests 106/106 for both variants; general regressions
PAL3 293/293 and PAL3A 310/310. Both-variant formatting checks passed.

* Remove prefab effect fallback and simplify effect editing
2026-11-14 22:33:13 +08:00

27 lines
859 B
C#

// ------------------------------------------------------------------------
// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved.
// See LICENSE file in the project root for license information.
// ------------------------------------------------------------------------
namespace Engine.Extensions
{
public static class UnityObjectExtensions
{
public static void Destroy(this UnityEngine.Object obj)
{
if (obj != null)
{
#if UNITY_EDITOR
// Model renderers are also used in isolated editor preview scenes.
if (!UnityEngine.Application.isPlaying)
{
UnityEngine.Object.DestroyImmediate(obj);
return;
}
#endif
UnityEngine.Object.Destroy(obj);
}
}
}
}