1
0
mirror of https://github.com/originalnicodr/CinematicUnityExplorer.git synced 2026-10-10 04:53:15 +08:00

Added "pause on finish" toggle for cam paths.

This commit is contained in:
originalnicodr
2024-02-10 16:47:59 -03:00
parent a7038ec378
commit ad426d4f83
2 changed files with 11 additions and 0 deletions
+7
View File
@@ -56,6 +56,7 @@ namespace UnityExplorer.UI.Panels
bool unpauseOnPlay;
bool waitBeforePlay;
private System.Timers.Timer startTimer;
public bool pauseOnFinish;
InputFieldRef alphaCatmullRomInput;
Slider alphaCatmullRomSlider;
@@ -153,6 +154,12 @@ namespace UnityExplorer.UI.Panels
unpauseOnPlayToggle.onValueChanged.AddListener((value) => unpauseOnPlay = value);
unpauseOnPlayText.text = "Unpause on play";
GameObject pauseOnFinishObj = UIFactory.CreateToggle(secondRow, "Pause on finish", out Toggle pauseOnFinishToggle, out Text pauseOnFinishText);
UIFactory.SetLayoutElement(pauseOnFinishObj, minHeight: 25, flexibleWidth: 9999);
pauseOnFinishToggle.isOn = false;
pauseOnFinishToggle.onValueChanged.AddListener((value) => pauseOnFinish = value);
pauseOnFinishText.text = "Pause on finish";
GameObject waitBeforePlayObj = UIFactory.CreateToggle(secondRow, "Wait before play", out Toggle waitBeforePlayToggle, out Text waitBeforePlayText);
UIFactory.SetLayoutElement(waitBeforePlayObj, minHeight: 25, flexibleWidth: 9999);
waitBeforePlayToggle.isOn = false;
+4
View File
@@ -405,6 +405,10 @@ namespace UnityExplorer.CatmullRom
playingPath = false;
delta = 0;
pauseCamCache = GetCurrentPoint();
if (UIManager.GetPanel<CamPaths>(UIManager.Panels.CamPaths).pauseOnFinish && !UIManager.GetTimeScaleWidget().IsPaused()){
UIManager.GetTimeScaleWidget().PauseToggle();
}
}
}
}