mirror of
https://github.com/0x7c13/Pal3.Unity.git
synced 2026-11-26 09:28:07 +08:00
* 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
61 lines
2.0 KiB
C#
61 lines
2.0 KiB
C#
// ------------------------------------------------------------------------
|
|
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
|
// See LICENSE file in the project root for license information.
|
|
// ------------------------------------------------------------------------
|
|
|
|
namespace Pal3.Core.DataReader.Par
|
|
{
|
|
using System;
|
|
using Primitives;
|
|
|
|
[Serializable]
|
|
public sealed class SparController
|
|
{
|
|
public int Kind;
|
|
public float[] Parameters;
|
|
}
|
|
|
|
[Serializable]
|
|
public sealed class SparKeyframe
|
|
{
|
|
public float Time;
|
|
public GameBoxVector3 Position;
|
|
public int EmissionMinimum, EmissionMaximum, Shape;
|
|
public float[] ShapeParameters;
|
|
public bool HasPath;
|
|
public float PathRate;
|
|
public GameBoxVector3[] PathPoints;
|
|
public GameBoxVector3 VelocityMinimum, VelocityMaximum;
|
|
public float RotationMinimum, RotationMaximum, SpinMinimum, SpinMaximum;
|
|
public GameBoxVector3 ColorMinimum, ColorMaximum;
|
|
public float AlphaMinimum, AlphaMaximum, LifeMinimum, LifeMaximum, SizeMinimum, SizeMaximum;
|
|
public int FrameMinimum, FrameMaximum;
|
|
public SparController[] Controllers;
|
|
public float[] Reserved;
|
|
}
|
|
|
|
[Serializable]
|
|
public sealed class SparGroup
|
|
{
|
|
public string Name, Texture;
|
|
public int Capacity, VertexCapacity, Mode;
|
|
public bool Loop;
|
|
// Rebuilt by the binary reader; jagged arrays are not Unity-serializable.
|
|
[NonSerialized]
|
|
public float[][] TextureFrames;
|
|
public SparKeyframe[] Keyframes;
|
|
}
|
|
|
|
[Serializable]
|
|
public sealed class SparFile
|
|
{
|
|
public float Version;
|
|
public SparGroup[] Groups;
|
|
public int Shader;
|
|
public float[] ShaderParameters;
|
|
// Some exported files contain an editor tail. The original loader closes
|
|
// the file after the shader parameters and never consumes this tail.
|
|
public int UnusedByteCount;
|
|
}
|
|
}
|