This commit is contained in:
SoulliesOfficial
2025-05-04 03:29:23 -04:00
parent 95e49cb499
commit 58b9d94540
10 changed files with 109 additions and 143 deletions

View File

@@ -62,6 +62,20 @@ namespace Ichni.RhythmGame
{
transformSubmodule = new TransformSubmodule(this);
}
public override void SetUpInspector()
{
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
base.SetUpInspector();
var container = inspector.GenerateContainer("Generate");
var generateAnimation = container.GenerateSubcontainer(3);
var displacementButton = inspector.GenerateButton(this, generateAnimation, "Displacement",
() => Displacement.GenerateElement("New Displacement", Guid.NewGuid(), new List<string>(), true, this,
new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat()));
var swirlButton = inspector.GenerateButton(this, generateAnimation, "Swirl",
() => Swirl.GenerateElement("New Swirl", Guid.NewGuid(), new List<string>(), true, this,
new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat()));
}
}
public partial class GameCamera
@@ -93,11 +107,18 @@ namespace Ichni.RhythmGame
}
public void SetTransformObserver()
{
Observable.EveryUpdate().Subscribe(_ =>
Observable.EveryLateUpdate().Subscribe(_ =>
{
if (transformSubmodule == null)
{
return;
}
bool willRefresh = false;
if (transformSubmodule.eulerAnglesOffsetLock)
{
rotationPoint.localEulerAngles = transformSubmodule.originalEulerAngles;
transform.localEulerAngles = transformSubmodule.originalEulerAngles;
}
else if (transformSubmodule.eulerAnglesDirtyMark)
{
@@ -108,8 +129,9 @@ namespace Ichni.RhythmGame
}
transformSubmodule.currentEulerAngles = transformSubmodule.originalEulerAngles + offset;
rotationPoint.localEulerAngles = transformSubmodule.currentEulerAngles;
transform.localEulerAngles = transformSubmodule.currentEulerAngles;
transformSubmodule.eulerAnglesDirtyMark = false;
willRefresh = true;
}
if (transformSubmodule.positionDirtyMark)
@@ -121,9 +143,19 @@ namespace Ichni.RhythmGame
}
transformSubmodule.currentPosition = transformSubmodule.originalPosition + offset;
positionPoint.localPosition = transformSubmodule.currentPosition;
transform.localPosition = transformSubmodule.currentPosition;
transformSubmodule.positionDirtyMark = false;
willRefresh = true;
}
if(willRefresh)
{
this.Refresh();
}
transformSubmodule.eulerAnglesOffset.Clear();
transformSubmodule.positionOffset.Clear();
}).AddTo(gameObject);
}
}