let play mode handle its own fade out
This commit is contained in:
parent
3a6727dcfa
commit
7c4c03c0cf
|
|
@ -892,8 +892,8 @@ MonoBehaviour:
|
|||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 24
|
||||
m_fontSizeBase: 24
|
||||
m_fontSize: 32
|
||||
m_fontSizeBase: 32
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 24
|
||||
|
|
@ -1339,7 +1339,7 @@ MonoBehaviour:
|
|||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 1920, y: 1080}
|
||||
m_ScreenMatchMode: 0
|
||||
m_ScreenMatchMode: 1
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
|
|
@ -6055,7 +6055,7 @@ RectTransform:
|
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 272, y: -64}
|
||||
m_AnchoredPosition: {x: 272.12793, y: -64}
|
||||
m_SizeDelta: {x: 256, y: 128}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1592423197
|
||||
|
|
@ -7329,7 +7329,7 @@ RectTransform:
|
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 816, y: -64}
|
||||
m_AnchoredPosition: {x: 816.3838, y: -64}
|
||||
m_SizeDelta: {x: 256, y: 128}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1923523152
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ namespace HeavenStudio
|
|||
|
||||
if (playMode)
|
||||
{
|
||||
StartCoroutine(WaitReadyAndPlayCo(startBeat));
|
||||
StartCoroutine(WaitReadyAndPlayCo(startBeat, 1f));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -331,17 +331,20 @@ namespace HeavenStudio
|
|||
|
||||
public void ScoreInputAccuracy(double beat, double accuracy, bool late, double time, float weight = 1, bool doDisplay = true, int category = 0)
|
||||
{
|
||||
totalInputs += weight;
|
||||
totalPlayerAccuracy += Math.Pow(accuracy, weight);
|
||||
|
||||
judgementInfo.inputs.Add(new JudgementManager.InputInfo
|
||||
if (weight > 0)
|
||||
{
|
||||
beat = beat,
|
||||
accuracyState = accuracy,
|
||||
timeOffset = time,
|
||||
weight = weight,
|
||||
category = category
|
||||
});
|
||||
totalInputs += weight;
|
||||
totalPlayerAccuracy += Math.Abs(accuracy) * weight;
|
||||
|
||||
judgementInfo.inputs.Add(new JudgementManager.InputInfo
|
||||
{
|
||||
beat = beat,
|
||||
accuracyState = accuracy,
|
||||
timeOffset = time,
|
||||
weight = weight,
|
||||
category = category
|
||||
});
|
||||
}
|
||||
|
||||
if (accuracy < Minigame.rankOkThreshold && weight > 0)
|
||||
{
|
||||
|
|
@ -644,6 +647,11 @@ namespace HeavenStudio
|
|||
inputs = new List<JudgementManager.InputInfo>(),
|
||||
medals = new List<JudgementManager.MedalInfo>()
|
||||
};
|
||||
|
||||
if (playMode && delay > 0)
|
||||
{
|
||||
GlobalGameManager.ForceFade(0, delay * 0.5f, delay * 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
StartCoroutine(PlayCo(beat, delay));
|
||||
|
|
|
|||
|
|
@ -165,15 +165,29 @@ namespace HeavenStudio
|
|||
instance.fadeImage.DOKill();
|
||||
instance.loadingText.enabled = false;
|
||||
memPanel.SetActive(false);
|
||||
instance.fadeImage.DOFade(0, fadeOut).OnComplete(() =>
|
||||
if (fadeOut < 0)
|
||||
{
|
||||
}
|
||||
else if (fadeOut == 0)
|
||||
{
|
||||
instance.fadeImage.color = new Color(0, 0, 0, 0);
|
||||
instance.fadeImage.gameObject.SetActive(false);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
instance.fadeImage.DOFade(0, fadeOut).OnComplete(() =>
|
||||
{
|
||||
instance.fadeImage.gameObject.SetActive(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator ForceFadeAsync(float hold, float fadeOut)
|
||||
{
|
||||
yield return new WaitForSeconds(hold);
|
||||
if (hold > 0)
|
||||
{
|
||||
yield return new WaitForSeconds(hold);
|
||||
}
|
||||
instance.fadeImage.DOKill();
|
||||
instance.loadingText.enabled = false;
|
||||
memPanel.SetActive(false);
|
||||
|
|
@ -246,13 +260,29 @@ namespace HeavenStudio
|
|||
{
|
||||
instance.fadeImage.DOKill();
|
||||
instance.fadeImage.gameObject.SetActive(true);
|
||||
instance.fadeImage.color = new Color(0, 0, 0, 0);
|
||||
instance.loadingText.enabled = false;
|
||||
instance.memPanel.SetActive(false);
|
||||
instance.fadeImage.DOFade(1, fadeIn).OnComplete(() =>
|
||||
if (fadeIn > 0)
|
||||
{
|
||||
instance.StartCoroutine(instance.ForceFadeAsync(hold, fadeOut));
|
||||
});
|
||||
instance.fadeImage.color = new Color(0, 0, 0, 0);
|
||||
instance.fadeImage.DOFade(1, fadeIn).OnComplete(() =>
|
||||
{
|
||||
instance.StartCoroutine(instance.ForceFadeAsync(hold, fadeOut));
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hold > 0 || fadeOut >= 0)
|
||||
{
|
||||
instance.fadeImage.color = new Color(0, 0, 0, 1);
|
||||
instance.StartCoroutine(instance.ForceFadeAsync(hold, fadeOut));
|
||||
}
|
||||
else
|
||||
{
|
||||
instance.fadeImage.color = new Color(0, 0, 0, 1);
|
||||
instance.fadeImage.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void ShowErrorMessage(string header, string message)
|
||||
|
|
|
|||
|
|
@ -220,6 +220,7 @@ namespace HeavenStudio
|
|||
chartDescText.text = beatmap["remixdesc"];
|
||||
|
||||
playPanel.SetActive(true);
|
||||
SoundByte.PlayOneShot("ui/UISelect");
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
|
|
@ -234,7 +235,7 @@ namespace HeavenStudio
|
|||
public void PlayPanelAccept()
|
||||
{
|
||||
SoundByte.PlayOneShot("ui/UIEnter");
|
||||
GlobalGameManager.LoadScene("Game", 0.35f, 0.5f);
|
||||
GlobalGameManager.LoadScene("Game", 0.35f, -1);
|
||||
}
|
||||
|
||||
public void PlayPanelBack()
|
||||
|
|
|
|||
|
|
@ -226,8 +226,8 @@ namespace HeavenStudio.Common
|
|||
void OnRestart()
|
||||
{
|
||||
UnPause(true);
|
||||
GlobalGameManager.ForceFade(0, 1f, 0.5f);
|
||||
GameManager.instance.Stop(0, true, 1.5f);
|
||||
GlobalGameManager.ForceFade(0, 0f, -1f);
|
||||
GameManager.instance.Stop(0, true, 1f);
|
||||
SoundByte.PlayOneShot("ui/UIEnter");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue