IEnumerator bug fix

master
tigerchen 6 years ago
parent f95b482003
commit 19c7a1a86e
  1. 2
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scenes/DarkSea.unity
  2. 12
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/StatManager.cs

@ -323,7 +323,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
fade_sec: 1
loop_to_trigger: 1
loop_to_trigger: 4
idle_player: {fileID: 540220394}
h_player: {fileID: 1232323602}
h_grp: {fileID: 1781519744}

@ -76,7 +76,7 @@ public class StatManager : MonoBehaviour
IEnumerator h_fade_in()
{
h_lerp_val = 0f;
while (h_grp.alpha <= 1f)
while (h_grp.alpha < 1f)
{
h_lerp_val += Time.deltaTime / fade_sec;
h_grp.alpha = Mathf.Lerp(0f, 1f, h_lerp_val);
@ -88,7 +88,7 @@ public class StatManager : MonoBehaviour
IEnumerator h_fade_out()
{
h_lerp_val = 1f;
while (h_grp.alpha >= 0f)
while (h_grp.alpha > 0f)
{
h_lerp_val -= Time.deltaTime / fade_sec;
h_grp.alpha = Mathf.Lerp(0f, 1f, h_lerp_val);
@ -100,9 +100,9 @@ public class StatManager : MonoBehaviour
IEnumerator s_fade_in()
{
s_lerp_val = 0f;
while (h_grp.alpha <= 1f)
while (s_grp.alpha < 1f)
{
s_lerp_val += Time.deltaTime / fade_sec;
s_lerp_val += Time.deltaTime*2f;
s_grp.alpha = Mathf.Lerp(0f, 1f, s_lerp_val);
yield return null;
}
@ -112,9 +112,9 @@ public class StatManager : MonoBehaviour
IEnumerator s_fade_out()
{
s_lerp_val = 1f;
while (h_grp.alpha >= 0f)
while (s_grp.alpha > 0f)
{
s_lerp_val -= Time.deltaTime / fade_sec;
s_lerp_val -= Time.deltaTime*2f;
s_grp.alpha = Mathf.Lerp(0f, 1f, s_lerp_val);
yield return null;
}

Loading…
Cancel
Save