|
|
|
@ -1,6 +1,8 @@ |
|
|
|
using System.Collections; |
|
|
|
using System.Collections; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Collections.Generic; |
|
|
|
using UnityEngine; |
|
|
|
using UnityEngine; |
|
|
|
|
|
|
|
using UltraCombos; |
|
|
|
|
|
|
|
using UnityEngine.UI; |
|
|
|
|
|
|
|
|
|
|
|
public class SnowFlake : MonoBehaviour |
|
|
|
public class SnowFlake : MonoBehaviour |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -11,9 +13,19 @@ public class SnowFlake : MonoBehaviour |
|
|
|
protected const string Spwan = "Snowflake_Spawn"; |
|
|
|
protected const string Spwan = "Snowflake_Spawn"; |
|
|
|
public bool IsPlay { get; private set; } |
|
|
|
public bool IsPlay { get; private set; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public AudioSource AudioSource; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private const float audioDelayTime = 0.5f; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public OverlayVfx OverlayVfx; |
|
|
|
|
|
|
|
public RawImage VfxImg; |
|
|
|
|
|
|
|
[SerializeField] private DShowMoviePlayer _vfxVideo; |
|
|
|
|
|
|
|
|
|
|
|
protected void Awake() |
|
|
|
protected void Awake() |
|
|
|
{ |
|
|
|
{ |
|
|
|
_animator = GetComponent<Animator>(); |
|
|
|
_animator = GetComponent<Animator>(); |
|
|
|
|
|
|
|
AudioSource = GetComponent<AudioSource>(); |
|
|
|
|
|
|
|
VfxImg.enabled = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -26,6 +38,10 @@ public class SnowFlake : MonoBehaviour |
|
|
|
CheckPlayEnd(); |
|
|
|
CheckPlayEnd(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(_vfxVideo != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
VfxImg.texture = _vfxVideo.Texture; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public virtual void CheckPlayEnd() |
|
|
|
public virtual void CheckPlayEnd() |
|
|
|
@ -53,6 +69,22 @@ public class SnowFlake : MonoBehaviour |
|
|
|
return; |
|
|
|
return; |
|
|
|
_animator.SetBool("Play", false); |
|
|
|
_animator.SetBool("Play", false); |
|
|
|
_animator.SetTrigger("Trigger"); |
|
|
|
_animator.SetTrigger("Trigger"); |
|
|
|
|
|
|
|
if(_vfxVideo == null) |
|
|
|
|
|
|
|
OverlayVfx.Take(out _vfxVideo); |
|
|
|
|
|
|
|
StartCoroutine(WaitToDelay()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IEnumerator WaitToDelay() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
yield return new WaitForSeconds(audioDelayTime); |
|
|
|
|
|
|
|
AudioSource?.Play(); |
|
|
|
|
|
|
|
yield return new WaitForSeconds(0.5f); |
|
|
|
|
|
|
|
if (_vfxVideo!= null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
_vfxVideo.Play(); |
|
|
|
|
|
|
|
VfxImg.texture = _vfxVideo.Texture; |
|
|
|
|
|
|
|
VfxImg.enabled = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public virtual void Reset() |
|
|
|
public virtual void Reset() |
|
|
|
@ -61,6 +93,12 @@ public class SnowFlake : MonoBehaviour |
|
|
|
_animator.SetTrigger("Reset"); |
|
|
|
_animator.SetTrigger("Reset"); |
|
|
|
_snowFlakeBehaviour.ResetFlake(); |
|
|
|
_snowFlakeBehaviour.ResetFlake(); |
|
|
|
IsPlay = false; |
|
|
|
IsPlay = false; |
|
|
|
|
|
|
|
if(_vfxVideo != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
OverlayVfx.Put(_vfxVideo); |
|
|
|
|
|
|
|
_vfxVideo = null; |
|
|
|
|
|
|
|
VfxImg.enabled = false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|