Remove use of animator in UI.
This commit is contained in:
@@ -13,8 +13,6 @@ namespace Cryville.Crtr.UI {
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
ResourceBrowserMaster m_browserMaster;
|
ResourceBrowserMaster m_browserMaster;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
Animator m_targetAnimator;
|
|
||||||
[SerializeField]
|
|
||||||
ProgressBar m_progressBar;
|
ProgressBar m_progressBar;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
PropertyMasterPanel m_settingsPanel;
|
PropertyMasterPanel m_settingsPanel;
|
||||||
@@ -47,21 +45,16 @@ namespace Cryville.Crtr.UI {
|
|||||||
m_progressBar.value = totalTasks == 0 ? 1 : (1 - (float)taskCount / totalTasks);
|
m_progressBar.value = totalTasks == 0 ? 1 : (1 - (float)taskCount / totalTasks);
|
||||||
if (taskCount == 0) {
|
if (taskCount == 0) {
|
||||||
initialized = true;
|
initialized = true;
|
||||||
m_targetAnimator.SetTrigger("T_Main");
|
// TODO Show main
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (unity::Input.GetKeyDown(KeyCode.Escape)) {
|
if (unity::Input.GetKeyDown(KeyCode.Escape)) {
|
||||||
if (m_targetAnimator != null) Back();
|
Back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string animatorState = null;
|
|
||||||
void OnDisable() {
|
|
||||||
animatorState = m_targetAnimator.GetCurrentAnimatorClipInfo(0)[0].clip.name;
|
|
||||||
}
|
|
||||||
void OnEnable() {
|
void OnEnable() {
|
||||||
Application.targetFrameRate = 60;
|
Application.targetFrameRate = 60;
|
||||||
if (animatorState != null) m_targetAnimator.PlayInFixedTime(animatorState, 0, 0);
|
|
||||||
Game.ResumeBackgroundTasks();
|
Game.ResumeBackgroundTasks();
|
||||||
}
|
}
|
||||||
#pragma warning restore IDE0051
|
#pragma warning restore IDE0051
|
||||||
@@ -76,7 +69,6 @@ namespace Cryville.Crtr.UI {
|
|||||||
if (obj.activeInHierarchy) return;
|
if (obj.activeInHierarchy) return;
|
||||||
}
|
}
|
||||||
if (m_browserMaster.Back()) return;
|
if (m_browserMaster.Back()) return;
|
||||||
m_targetAnimator.SetTrigger("G_Back");
|
|
||||||
if (_uiStack.Count <= 1) return;
|
if (_uiStack.Count <= 1) return;
|
||||||
_uiStack.Pop();
|
_uiStack.Pop();
|
||||||
m_title.SetText(_uiStack.Peek());
|
m_title.SetText(_uiStack.Peek());
|
||||||
|
Reference in New Issue
Block a user