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:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user