Cross Track Point和Trail的进一步制作,修复Duplicate的Guid Bug

Ctrl+M切摄像机
This commit is contained in:
SoulliesOfficial
2025-03-01 00:28:26 -05:00
parent 210e594808
commit 191be59c3d
33 changed files with 790 additions and 1604 deletions

View File

@@ -67,21 +67,24 @@ namespace Ichni.RhythmGame
/// <returns>返回距离当前时间最近的前一个AnimatedInt</returns>
AnimatedInt GetAnimatedInt(float nowTime)
{
if (nowTime < animations[0].time)
{
return animations[0];
}
if (nowTime > animations[animations.Count - 1].time)
{
return animations[animations.Count - 1];
}
for (int i = 0; i < animations.Count; i++)
{
if (nowTime < animations[i].time)
{
if (i == 0)
{
return animations[i];
}
else
{
return animations[i - 1];
}
return animations[i - 1];
}
}
return new AnimatedInt(0, 0);
}

View File

@@ -102,10 +102,10 @@ namespace Ichni.RhythmGame
var currentRotText =
inspector.GenerateParameterText(this, container, "Current Rotation", nameof(currentEulerAngles), true);
if (attachedGameElement is PathNode pathNode) // 如果是PathNode显示法线方向
if (attachedGameElement is PathNode or Trail) // 如果是PathNode显示法线方向
{
var currentNormalText =
inspector.GenerateHintText(this, container, () => "Normal: " + pathNode.transform.forward);
inspector.GenerateHintText(this, container, () => "Normal: " + attachedGameElement.transform.forward);
}
var currentScaleText =

View File

@@ -68,6 +68,9 @@ namespace Ichni.RhythmGame
{
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);
}