排障 小修改

This commit is contained in:
2025-04-20 12:18:19 +08:00
parent 87e4a0aa98
commit 83241a5814
20 changed files with 4825 additions and 936 deletions

View File

@@ -67,7 +67,7 @@ namespace Ichni.RhythmGame
elementList.ForEach(element =>
{
#if UNITY_EDITOR
//#if UNITY_EDITOR
if (element == null)
@@ -80,12 +80,10 @@ namespace Ichni.RhythmGame
{
return;
}
#endif
//#endif
if (element is GameElement_BM gameElement)
{
#if UNITY_EDITOR
//Debug.Log("Adding element to identifier: " + gameElement.elementName + " " + gameElement.elementGuid);
#endif
GameElement_BM.identifier.Add(gameElement.elementGuid, gameElement);
}
@@ -97,6 +95,7 @@ namespace Ichni.RhythmGame
if (element == null)
{
Debug.LogError("Null element detected in elementList during low-priority execution. Skipping execution.");
return;
}

View File

@@ -26,10 +26,10 @@ namespace Ichni.RhythmGame
AnimationCurve widthCurve, Gradient gradient, Material material = null)
{
gradient ??= ColorExtensions.DefaultGradient();
Trail trail = Instantiate(EditorManager.instance.basePrefabs.trail, parentElement.transform).GetComponent<Trail>();
trail.trailRenderer = trail.GetComponent<TrailRenderer>();
trail.Initialize(name, id, tags, isFirstGenerated, parentElement);
trail.renderMaterial = material == null ? EditorManager.instance.basePrefabs.defaultTrailMaterial : material;
@@ -60,7 +60,7 @@ namespace Ichni.RhythmGame
public override void SaveBM()
{
matchedBM = new Trail_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM,
visibleTimeLength, isAutoOrient, widthMultiplier, widthCurve, renderMaterial);
visibleTimeLength, isAutoOrient, widthMultiplier, widthCurve, renderMaterial, gradient);
}
public override void SetUpInspector()
@@ -88,7 +88,7 @@ namespace Ichni.RhythmGame
widthCurveWindow.SetAsCustomCurve();
widthCurveWindow.closeButton.onClick.AddListener(() => trailRenderer.widthCurve = widthCurve);
});
var colorSettings = container.GenerateSubcontainer(3);
var gradientColorKeysButton = inspector.GenerateButton(this, colorSettings, "Gradient Color Keys", () =>
{
@@ -144,7 +144,7 @@ namespace Ichni.RhythmGame
public Trail_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement,
float visibleTimeLength, bool isAutoOrient, float widthMultiplier,
AnimationCurve widthCurve, Material renderMaterial) : base(elementName, elementGuid, tags,
AnimationCurve widthCurve, Material renderMaterial, Gradient gradient) : base(elementName, elementGuid, tags,
attachedElement)
{
this.visibleTimeLength = visibleTimeLength;
@@ -152,6 +152,7 @@ namespace Ichni.RhythmGame
this.isAutoOrient = isAutoOrient;
this.widthMultiplier = widthMultiplier;
this.widthCurve = widthCurve;
this.gradient = gradient;
}
public override void ExecuteBM()