|
|
|
|
@ -37,41 +37,29 @@ public class StatManager : MonoBehaviour |
|
|
|
|
loop_count = 0; |
|
|
|
|
h_lerp_val = 0f; |
|
|
|
|
s_lerp_val = 1f; |
|
|
|
|
m_timer = h_total_time; |
|
|
|
|
// m_timer = h_total_time; |
|
|
|
|
m_timer = 0f; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Update() |
|
|
|
|
{ |
|
|
|
|
trigger_time = i_total_time * loop_to_trigger + h_total_time; |
|
|
|
|
trigger_time = i_total_time * loop_to_trigger; |
|
|
|
|
//if(h_player.IsPlaying == falss) |
|
|
|
|
m_timer += Time.deltaTime; |
|
|
|
|
Debug.Log(m_timer); |
|
|
|
|
//Debug.Log(m_timer); |
|
|
|
|
|
|
|
|
|
//if(h_player.IsPlaying == false){ |
|
|
|
|
if (true) |
|
|
|
|
{ |
|
|
|
|
//if (idle_player.Frame == idle_player.TotalNumFrames) |
|
|
|
|
//{ |
|
|
|
|
// loop_count += 1; |
|
|
|
|
//Debug.Log(loop_count); |
|
|
|
|
//} |
|
|
|
|
//if (loop_count >= loop_to_trigger) |
|
|
|
|
if (m_timer > trigger_time) |
|
|
|
|
{ |
|
|
|
|
aud = gameObject.AddComponent<AudioSource>(); |
|
|
|
|
aud.loop = false; |
|
|
|
|
aud.playOnAwake = false; |
|
|
|
|
aud.clip = horse_clip; |
|
|
|
|
aud.Play(); |
|
|
|
|
m_timer = 0f; |
|
|
|
|
Debug.Log("horse fade in"); |
|
|
|
|
h_player.Play(); |
|
|
|
|
StartCoroutine("h_fade_in"); |
|
|
|
|
loop_count = 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (h_player.IsPlaying) |
|
|
|
|
{ |
|
|
|
|
//if (h_player.IsPlaying) |
|
|
|
|
/*if (false) |
|
|
|
|
{ |
|
|
|
|
if(h_player.GetCurrentTime == 18f) |
|
|
|
|
{ |
|
|
|
|
Debug.Log("snow out"); |
|
|
|
|
@ -90,12 +78,47 @@ public class StatManager : MonoBehaviour |
|
|
|
|
Debug.Log("horse fade out"); |
|
|
|
|
StartCoroutine("h_fade_out"); |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
if(m_timer > trigger_time + h_total_time) |
|
|
|
|
{ |
|
|
|
|
m_timer = 0f; |
|
|
|
|
} |
|
|
|
|
else if (m_timer > trigger_time + h_total_time - fade_sec) |
|
|
|
|
{ |
|
|
|
|
Debug.Log("horse fade out"); |
|
|
|
|
StartCoroutine("h_fade_out"); |
|
|
|
|
} |
|
|
|
|
else if (m_timer > trigger_time + 27f) |
|
|
|
|
{ |
|
|
|
|
Debug.Log("snow in"); |
|
|
|
|
StartCoroutine("s_fade_in"); |
|
|
|
|
} |
|
|
|
|
else if (m_timer > trigger_time + 18f) |
|
|
|
|
{ |
|
|
|
|
Debug.Log("snow out"); |
|
|
|
|
StartCoroutine("s_fade_out"); |
|
|
|
|
} |
|
|
|
|
else if (m_timer > trigger_time) |
|
|
|
|
{ |
|
|
|
|
aud = gameObject.AddComponent<AudioSource>(); |
|
|
|
|
aud.loop = false; |
|
|
|
|
aud.playOnAwake = false; |
|
|
|
|
aud.clip = horse_clip; |
|
|
|
|
aud.Play(); |
|
|
|
|
h_player.Play(); |
|
|
|
|
//m_timer = 0f; |
|
|
|
|
Debug.Log("horse fade in"); |
|
|
|
|
|
|
|
|
|
StartCoroutine("h_fade_in"); |
|
|
|
|
loop_count = 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
IEnumerator h_fade_in() |
|
|
|
|
{ |
|
|
|
|
h_lerp_val = 0f; |
|
|
|
|
//h_lerp_val = 0f; |
|
|
|
|
while (h_grp.alpha < 1f) |
|
|
|
|
{ |
|
|
|
|
h_lerp_val += Time.deltaTime / fade_sec; |
|
|
|
|
@ -107,7 +130,7 @@ public class StatManager : MonoBehaviour |
|
|
|
|
|
|
|
|
|
IEnumerator h_fade_out() |
|
|
|
|
{ |
|
|
|
|
h_lerp_val = 1f; |
|
|
|
|
//h_lerp_val = 1f; |
|
|
|
|
while (h_grp.alpha > 0f) |
|
|
|
|
{ |
|
|
|
|
h_lerp_val -= Time.deltaTime / fade_sec; |
|
|
|
|
@ -120,7 +143,7 @@ public class StatManager : MonoBehaviour |
|
|
|
|
|
|
|
|
|
IEnumerator s_fade_in() |
|
|
|
|
{ |
|
|
|
|
s_lerp_val = 0f; |
|
|
|
|
//s_lerp_val = 0f; |
|
|
|
|
while (s_grp.alpha < 1f) |
|
|
|
|
{ |
|
|
|
|
s_lerp_val += Time.deltaTime*2f; |
|
|
|
|
@ -132,7 +155,7 @@ public class StatManager : MonoBehaviour |
|
|
|
|
|
|
|
|
|
IEnumerator s_fade_out() |
|
|
|
|
{ |
|
|
|
|
s_lerp_val = 1f; |
|
|
|
|
//s_lerp_val = 1f; |
|
|
|
|
while (s_grp.alpha > 0f) |
|
|
|
|
{ |
|
|
|
|
s_lerp_val -= Time.deltaTime*2f; |
|
|
|
|
|