|
|
|
@ -20,10 +20,16 @@ public class StatManager : MonoBehaviour |
|
|
|
public DShowMoviePlayer h_player; |
|
|
|
public DShowMoviePlayer h_player; |
|
|
|
public CanvasGroup h_grp; |
|
|
|
public CanvasGroup h_grp; |
|
|
|
public CanvasGroup s_grp; |
|
|
|
public CanvasGroup s_grp; |
|
|
|
|
|
|
|
public AudioClip horse_clip; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AudioSource aud; |
|
|
|
int loop_count; |
|
|
|
int loop_count; |
|
|
|
float h_lerp_val; |
|
|
|
float h_lerp_val; |
|
|
|
float s_lerp_val; |
|
|
|
float s_lerp_val; |
|
|
|
|
|
|
|
float h_total_time = 30f; |
|
|
|
|
|
|
|
float i_total_time = 8f; |
|
|
|
|
|
|
|
float trigger_time; |
|
|
|
|
|
|
|
float m_timer; |
|
|
|
|
|
|
|
|
|
|
|
void Start() |
|
|
|
void Start() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -31,18 +37,32 @@ public class StatManager : MonoBehaviour |
|
|
|
loop_count = 0; |
|
|
|
loop_count = 0; |
|
|
|
h_lerp_val = 0f; |
|
|
|
h_lerp_val = 0f; |
|
|
|
s_lerp_val = 1f; |
|
|
|
s_lerp_val = 1f; |
|
|
|
|
|
|
|
m_timer = h_total_time; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Update() |
|
|
|
void Update() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(h_player.IsPlaying == false){ |
|
|
|
trigger_time = i_total_time * loop_to_trigger + h_total_time; |
|
|
|
if (idle_player.Frame == idle_player.TotalNumFrames) |
|
|
|
m_timer += Time.deltaTime; |
|
|
|
{ |
|
|
|
Debug.Log(m_timer); |
|
|
|
loop_count += 1; |
|
|
|
|
|
|
|
|
|
|
|
//if(h_player.IsPlaying == false){ |
|
|
|
|
|
|
|
if (true) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
//if (idle_player.Frame == idle_player.TotalNumFrames) |
|
|
|
|
|
|
|
//{ |
|
|
|
|
|
|
|
// loop_count += 1; |
|
|
|
//Debug.Log(loop_count); |
|
|
|
//Debug.Log(loop_count); |
|
|
|
} |
|
|
|
//} |
|
|
|
if (loop_count >= loop_to_trigger) |
|
|
|
//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"); |
|
|
|
Debug.Log("horse fade in"); |
|
|
|
h_player.Play(); |
|
|
|
h_player.Play(); |
|
|
|
StartCoroutine("h_fade_in"); |
|
|
|
StartCoroutine("h_fade_in"); |
|
|
|
@ -50,7 +70,7 @@ public class StatManager : MonoBehaviour |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
else |
|
|
|
if (h_player.IsPlaying) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(h_player.GetCurrentTime == 18f) |
|
|
|
if(h_player.GetCurrentTime == 18f) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -64,9 +84,9 @@ public class StatManager : MonoBehaviour |
|
|
|
StartCoroutine("s_fade_in"); |
|
|
|
StartCoroutine("s_fade_in"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(h_player.Frame == h_player.TotalNumFrames - fade_sec * 30) |
|
|
|
if(h_player.GetCurrentTime > h_total_time - fade_sec) |
|
|
|
{ |
|
|
|
{ |
|
|
|
idle_player.Frame = 0; |
|
|
|
//idle_player.Frame = 0; |
|
|
|
Debug.Log("horse fade out"); |
|
|
|
Debug.Log("horse fade out"); |
|
|
|
StartCoroutine("h_fade_out"); |
|
|
|
StartCoroutine("h_fade_out"); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -94,6 +114,7 @@ public class StatManager : MonoBehaviour |
|
|
|
h_grp.alpha = Mathf.Lerp(0f, 1f, h_lerp_val); |
|
|
|
h_grp.alpha = Mathf.Lerp(0f, 1f, h_lerp_val); |
|
|
|
yield return null; |
|
|
|
yield return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Destroy(aud); |
|
|
|
yield break; |
|
|
|
yield break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|