menu
This commit is contained in:
@@ -80,14 +80,11 @@ namespace Ichni.RhythmGame
|
||||
scaleDirtyMark = true;
|
||||
|
||||
eulerAnglesOffsetLock = false;
|
||||
|
||||
attachedGameElement.transform.localScale = currentScale;
|
||||
attachedGameElement.transform.localEulerAngles = currentEulerAngles;
|
||||
attachedGameElement.transform.localPosition = currentPosition;
|
||||
|
||||
|
||||
if (!HaveSameSubmodule)
|
||||
{
|
||||
(attachedGameElement as IHaveTransformSubmodule).transformSubmodule = this;
|
||||
(attachedGameElement as IHaveTransformSubmodule).UpdateTransform(false);
|
||||
(attachedGameElement as IHaveTransformSubmodule).SetTransformObserver();
|
||||
}
|
||||
}
|
||||
@@ -127,17 +124,13 @@ namespace Ichni.RhythmGame
|
||||
public void SetTransformObserver()
|
||||
{
|
||||
transformSubmodule.observer = Observable.EveryUpdate()
|
||||
.Where(_ => GameManager.instance.audioManager.isUpdating)
|
||||
.Subscribe(_ => UpdateTransform())
|
||||
.AddTo(transformSubmodule.attachedGameElement);
|
||||
}
|
||||
|
||||
public void UpdateTransform()
|
||||
public void UpdateTransform(bool refreshAll = true)
|
||||
{
|
||||
if (!GameManager.instance.audioManager.isUpdating)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GameElement attachedGameElement = transformSubmodule.attachedGameElement;
|
||||
bool willRefresh = false;
|
||||
|
||||
@@ -168,7 +161,7 @@ namespace Ichni.RhythmGame
|
||||
transformSubmodule.positionOffset = Vector3.zero;
|
||||
}
|
||||
|
||||
if(willRefresh)
|
||||
if(refreshAll && willRefresh)
|
||||
{
|
||||
attachedGameElement.Refresh();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user