Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
@@ -20,6 +20,11 @@ namespace Ichni.RhythmGame
|
||||
public Gradient gradient;
|
||||
|
||||
public TransformSubmodule transformSubmodule { get; set; }
|
||||
float IHaveTrail.visibleTimeLength
|
||||
{
|
||||
get => visibleTimeLength;
|
||||
set => visibleTimeLength = value;
|
||||
}
|
||||
|
||||
public static Trail GenerateElement(string name, Guid id, List<string> tags, bool isFirstGenerated,
|
||||
GameElement parentElement, float visibleTimeLength, bool isAutoOrient, float widthMultiplier,
|
||||
@@ -121,11 +126,42 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void FreezeAllTrails(bool freeze)
|
||||
{
|
||||
foreach (GameElement x in EditorManager.instance.beatmapContainer.gameElementList)
|
||||
{
|
||||
if (x is IHaveTrail t && t != null)
|
||||
{
|
||||
FreezeTrail(freeze, t);
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void FreezeTrail(bool freeze, IHaveTrail trail)
|
||||
{
|
||||
|
||||
|
||||
if (!freeze)
|
||||
{
|
||||
UnfreezeTrail(trail);
|
||||
return;
|
||||
}
|
||||
trail.trailRenderer.time = Mathf.Infinity; // 使现有轨迹永不消失
|
||||
trail.trailRenderer.emitting = false; // 停止生成新轨迹点
|
||||
}
|
||||
|
||||
// 解冻尾迹(恢复动态更新)
|
||||
public static void UnfreezeTrail(IHaveTrail trail)
|
||||
{
|
||||
trail.trailRenderer.Clear(); // 清除当前冻结的轨迹
|
||||
trail.trailRenderer.time = trail.visibleTimeLength; // 恢复原始持续时间
|
||||
trail.trailRenderer.emitting = true; // 重新开始发射轨迹点
|
||||
}
|
||||
}
|
||||
|
||||
public interface IHaveTrail
|
||||
{
|
||||
TrailRenderer trailRenderer { get; set; }
|
||||
float visibleTimeLength { get; set; }
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
|
||||
Reference in New Issue
Block a user