改动与优化
This commit is contained in:
@@ -57,6 +57,7 @@ public class pressStart : MonoBehaviour
|
||||
// polling
|
||||
private Coroutine pollCoroutine;
|
||||
private float pollInterval = 3f;
|
||||
private UI_PanelPopupTween helpPopupTween;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
@@ -90,6 +91,11 @@ public class pressStart : MonoBehaviour
|
||||
}
|
||||
if (helpContentObject != null)
|
||||
{
|
||||
helpPopupTween = helpContentObject.GetComponent<UI_PanelPopupTween>();
|
||||
if (helpPopupTween == null)
|
||||
{
|
||||
helpPopupTween = helpContentObject.AddComponent<UI_PanelPopupTween>();
|
||||
}
|
||||
helpContentObject.SetActive(false);
|
||||
}
|
||||
|
||||
@@ -198,7 +204,22 @@ public class pressStart : MonoBehaviour
|
||||
if (helpContentObject != null)
|
||||
{
|
||||
bool isActive = helpContentObject.activeSelf;
|
||||
helpContentObject.SetActive(!isActive);
|
||||
if (isActive)
|
||||
{
|
||||
HideHelpContentWithExitAnim();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (helpPopupTween == null)
|
||||
{
|
||||
helpPopupTween = helpContentObject.GetComponent<UI_PanelPopupTween>();
|
||||
if (helpPopupTween == null)
|
||||
{
|
||||
helpPopupTween = helpContentObject.AddComponent<UI_PanelPopupTween>();
|
||||
}
|
||||
}
|
||||
helpContentObject.SetActive(true);
|
||||
}
|
||||
Debug.Log("[pressStart] Help button clicked. Help content active: " + !isActive);
|
||||
}
|
||||
}
|
||||
@@ -207,11 +228,27 @@ public class pressStart : MonoBehaviour
|
||||
{
|
||||
if (helpContentObject != null)
|
||||
{
|
||||
helpContentObject.SetActive(false);
|
||||
HideHelpContentWithExitAnim();
|
||||
Debug.Log("[pressStart] Close button clicked. Help content hidden.");
|
||||
}
|
||||
}
|
||||
|
||||
private void HideHelpContentWithExitAnim()
|
||||
{
|
||||
if (helpContentObject == null || !helpContentObject.activeInHierarchy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UI_PanelExitUtility.PlayExitThen(helpContentObject, () =>
|
||||
{
|
||||
if (helpContentObject != null)
|
||||
{
|
||||
helpContentObject.SetActive(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void OnExitButtonClick()
|
||||
{
|
||||
Debug.Log("[pressStart] Exit button clicked. Application quitting.");
|
||||
|
||||
Reference in New Issue
Block a user