Rhythm Rally: Fixed broken background in editor preview. FreeCam components can now be enabled/disabled with ctrl+shift+D.

This commit is contained in:
Jenny Crowe
2022-02-20 06:57:20 -07:00
parent 186dac1757
commit 2d996ba3c1
4 changed files with 26 additions and 5 deletions

View File

@ -34,7 +34,7 @@ namespace RhythmHeavenMania
public float startOffset;
public bool playOnStart;
public float startBeat;
private GameObject currentGameO;
[NonSerialized] public GameObject currentGameO;
public bool autoplay;
public event Action<float> onBeatChanged;

View File

@ -134,6 +134,14 @@ namespace RhythmHeavenMania.Editor
{
CommandManager.instance.Redo();
}
if (Input.GetKey(KeyCode.LeftShift))
{
if (Input.GetKeyDown(KeyCode.D))
{
ToggleDebugCam();
}
}
}
if (Timeline.instance.timelineState.selected && Editor.instance.canSelect)
@ -415,5 +423,18 @@ namespace RhythmHeavenMania.Editor
{
return (rectTransform.gameObject.activeSelf && RectTransformUtility.RectangleContainsScreenPoint(rectTransform, Input.mousePosition, Editor.instance.EditorCamera));
}
public void ToggleDebugCam()
{
var game = GameManager.instance.currentGameO;
if (game != null)
{
foreach(FreeCam c in game.GetComponentsInChildren<FreeCam>(true))
{
c.enabled = !c.enabled;
}
}
}
}
}