LookAt,Offset,Effect Remove

Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
2025-07-13 11:55:44 +08:00
parent 46766a39e0
commit c4c1c05ed6
46 changed files with 16260 additions and 17707 deletions

View File

@@ -15,7 +15,7 @@ namespace Ichni.RhythmGame
/// </summary>
public partial class LookAt : AnimationBase
{
public GameElement targetGameElement;
public TransformSubmodule targetTransformSubmodule;
public GameElement lookAtObject;
public FlexibleBool enabling;
@@ -33,9 +33,9 @@ namespace Ichni.RhythmGame
look.enabling = enabling;
look.animationReturnType = FlexibleReturnType.Before;
look.targetGameElement = lookAtTarget;
look.targetTransformSubmodule = (animatedObject as IHaveTransformSubmodule).transformSubmodule;
//look.timeDurationSubmodule.SetDuration(-999f, 999f); //TODO: 换为(-delay, songLength)
@@ -49,8 +49,9 @@ namespace Ichni.RhythmGame
protected override void UpdateAnimation(float songTime)
{
if (lookAtObject is null) return;
enabling.UpdateFlexibleBool(songTime);
if (enabling.value)
{
animationReturnType = FlexibleReturnType.MiddleExecuting;
@@ -58,13 +59,17 @@ namespace Ichni.RhythmGame
Vector3 eulerAnglesOffset = Quaternion.LookRotation(lookingDirection).eulerAngles;
targetTransformSubmodule.eulerAnglesOffsetLock = true;
targetTransformSubmodule.currentEulerAngles = eulerAnglesOffset;
targetTransformSubmodule.eulerAnglesOffset.Add(eulerAnglesOffset);
targetTransformSubmodule.eulerAnglesDirtyMark = true;
// targetTransformSubmodule.eulerAnglesOffsetLock = true;
// targetTransformSubmodule.currentEulerAngles = eulerAnglesOffset;
}
else
{
if (animationReturnType != FlexibleReturnType.MiddleInterval) targetTransformSubmodule.eulerAnglesOffset.Add(Vector3.zero);
targetTransformSubmodule.eulerAnglesDirtyMark = true;
animationReturnType = FlexibleReturnType.MiddleInterval;
targetTransformSubmodule.eulerAnglesOffsetLock = false;
// targetTransformSubmodule.eulerAnglesOffsetLock = false;
}
}
@@ -73,7 +78,7 @@ namespace Ichni.RhythmGame
matchedBM = new LookAt_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM,
enabling.ConvertToBM(), lookAtObject.elementGuid);
}
public override void ApplyTimeOffset(float offset)
{
base.ApplyTimeOffset(offset);
@@ -87,35 +92,35 @@ namespace Ichni.RhythmGame
{
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
Inspector inspectorMain = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Enable Control");
var effectSettings = container.GenerateSubcontainer(3);
var connectedGameElementInputField = inspector.GenerateInputField(effectSettings, "Game Element Name");
var effectSettings = container.GenerateSubcontainer(2);
var connectedGameElementInputField = inspector.GenerateInputField(effectSettings, "Try Get Element");
var connectGameElementButton = inspector.GenerateButton(this, effectSettings, "Connect Game Element", () =>
{
GameElement targetElement = EditorManager.instance.beatmapContainer.gameElementList
.First(e => e.elementName == connectedGameElementInputField.GetValue<string>());
if (targetElement == null)
{
LogWindow.Log("Game Element not found.", Color.red);
LogWindow.Log("Game Element not found.", Color.yellow);
}
targetGameElement = targetElement;
targetTransformSubmodule = (targetElement as IHaveTransformSubmodule).transformSubmodule;
lookAtObject = targetElement;
//targetTransformSubmodule = (targetElement as IHaveTransformSubmodule).transformSubmodule;
inspectorMain.SetInspector(this);
});
string ShowConnection() => targetGameElement == null ? "No Game Element Connected" : "Connected With: " + targetGameElement.elementName;
string ShowConnection() => lookAtObject == null ? "No Game Element Connected" : "Connected With: " + lookAtObject.elementName;
var connectHintText = inspector.GenerateHintText(this, effectSettings, ShowConnection);
var enablingButton = inspector.GenerateButton(this, effectSettings, "Enabling", () =>
{
inspector.GenerateCompositeParameterWindow(this, "Enabling", nameof(enabling)).SetAsFlexibleBool();
});
}
}
namespace Beatmap
{
public class LookAt_BM : GameElement_BM
@@ -134,16 +139,16 @@ namespace Ichni.RhythmGame
this.enabling = enabling;
this.lookAtObjectGuid = lookAtObjectGuid;
}
public override void ExecuteBM()
{
matchedElement = LookAt.GenerateElement(elementName, elementGuid, tags, false,
GetElement(attachedElementGuid), GetElement(lookAtObjectGuid), enabling.ConvertToGameType());
}
public override GameElement DuplicateBM(GameElement parent)
{
return LookAt.GenerateElement(elementName, Guid.NewGuid(), tags, false, parent,
return LookAt.GenerateElement(elementName, Guid.NewGuid(), tags, false, parent,
GetElement(lookAtObjectGuid), enabling.ConvertToGameType());
}
}