修改粒子追踪器

Signed-off-by: TRADER_FOER <lhf190@outlook.com>
This commit is contained in:
2026-07-29 22:23:06 +08:00
parent 923fc5359f
commit 58afd6acc1
2 changed files with 12 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
using System; using System;
using Dreamteck.Splines;
using UnityEngine; using UnityEngine;
namespace Ichni.RhythmGame.Beatmap namespace Ichni.RhythmGame.Beatmap
@@ -21,6 +22,7 @@ namespace Ichni.RhythmGame.Beatmap
public string materialThemeBundleName = string.Empty; public string materialThemeBundleName = string.Empty;
public string materialName = string.Empty; public string materialName = string.Empty;
public ParticleController.PathNodeSizeMode pathNodeSizeMode = ParticleController.PathNodeSizeMode.LegacyOffset;
public ParticleTracker_BM() public ParticleTracker_BM()
{ {
@@ -32,7 +34,8 @@ namespace Ichni.RhythmGame.Beatmap
bool is3D, float width, Vector3 extendDirection, bool is3D, float width, Vector3 extendDirection,
float density, float lifeTime, float density, float lifeTime,
bool isAutoOrient, Vector3 particleRotation, bool isAutoOrient, Vector3 particleRotation,
string materialThemeBundleName, string materialName) : base(elementName, elementGuid, tags, attachedElement) string materialThemeBundleName, string materialName,
ParticleController.PathNodeSizeMode pathNodeSizeMode = ParticleController.PathNodeSizeMode.LegacyOffset) : base(elementName, elementGuid, tags, attachedElement)
{ {
this.prewarm = prewarm; this.prewarm = prewarm;
this.playTime = playTime; this.playTime = playTime;
@@ -47,6 +50,7 @@ namespace Ichni.RhythmGame.Beatmap
this.materialThemeBundleName = materialThemeBundleName; this.materialThemeBundleName = materialThemeBundleName;
this.materialName = materialName; this.materialName = materialName;
this.pathNodeSizeMode = pathNodeSizeMode;
} }
public override void ExecuteBM() public override void ExecuteBM()
@@ -54,7 +58,8 @@ namespace Ichni.RhythmGame.Beatmap
matchedElement = ParticleTracker.GenerateElement( matchedElement = ParticleTracker.GenerateElement(
elementName, elementGuid, tags, false, elementName, elementGuid, tags, false,
GetElement(attachedElementGuid) as Track, materialThemeBundleName, materialName, GetElement(attachedElementGuid) as Track, materialThemeBundleName, materialName,
prewarm, playTime, stopTime, is3D, width, extendDirection, density, lifeTime, isAutoOrient, particleRotation); prewarm, playTime, stopTime, is3D, width, extendDirection, density, lifeTime, isAutoOrient, particleRotation,
pathNodeSizeMode);
} }
} }
} }

View File

@@ -26,6 +26,7 @@ namespace Ichni.RhythmGame
public float lifeTime; public float lifeTime;
public bool isAutoOrient; public bool isAutoOrient;
public Vector3 particleRotation; public Vector3 particleRotation;
public ParticleController.PathNodeSizeMode pathNodeSizeMode;
#endregion #endregion
#region [] Calculated & Cached States #region [] Calculated & Cached States
@@ -45,7 +46,8 @@ namespace Ichni.RhythmGame
bool prewarm, float playTime, float stopTime, bool prewarm, float playTime, float stopTime,
bool is3D, float width, Vector3 extendDirection, bool is3D, float width, Vector3 extendDirection,
float density, float lifeTime, float density, float lifeTime,
bool isAutoOrient, Vector3 particleRotation) bool isAutoOrient, Vector3 particleRotation,
ParticleController.PathNodeSizeMode pathNodeSizeMode = ParticleController.PathNodeSizeMode.LegacyOffset)
{ {
ParticleTracker particleTracker = Instantiate(GameManager.Instance.basePrefabs.particleTracker, track.transform) ParticleTracker particleTracker = Instantiate(GameManager.Instance.basePrefabs.particleTracker, track.transform)
.GetComponent<ParticleTracker>(); .GetComponent<ParticleTracker>();
@@ -57,6 +59,7 @@ namespace Ichni.RhythmGame
particleTracker.stopTime = stopTime; particleTracker.stopTime = stopTime;
particleTracker.themeBundleName = themeBundleName; particleTracker.themeBundleName = themeBundleName;
particleTracker.materialName = materialName; particleTracker.materialName = materialName;
particleTracker.pathNodeSizeMode = pathNodeSizeMode;
(particleTracker as IHaveParticles).SetParticleMaterial(themeBundleName, materialName); (particleTracker as IHaveParticles).SetParticleMaterial(themeBundleName, materialName);
particleTracker.SetParticleSettings(prewarm, is3D, width, extendDirection, density, lifeTime, isAutoOrient, particleRotation); particleTracker.SetParticleSettings(prewarm, is3D, width, extendDirection, density, lifeTime, isAutoOrient, particleRotation);
return particleTracker; return particleTracker;
@@ -137,6 +140,7 @@ namespace Ichni.RhythmGame
particleController.is3D = is3D; particleController.is3D = is3D;
particleController.width = width; particleController.width = width;
particleController.extendDirection = extendDirection; particleController.extendDirection = extendDirection;
particleController.pathNodeSizeMode = pathNodeSizeMode;
particleController.Rebuild(); particleController.Rebuild();
} }