|
@@ -4,7 +4,6 @@ using UnityEngine.Video;
|
|
using YooAsset;
|
|
using YooAsset;
|
|
using GFGGame.Launcher;
|
|
using GFGGame.Launcher;
|
|
using System.Collections;
|
|
using System.Collections;
|
|
-using System;
|
|
|
|
|
|
|
|
namespace GFGGame
|
|
namespace GFGGame
|
|
{
|
|
{
|
|
@@ -20,7 +19,6 @@ namespace GFGGame
|
|
private Button BtnSkipVertical;
|
|
private Button BtnSkipVertical;
|
|
private Button BtnSkipHorizontal;
|
|
private Button BtnSkipHorizontal;
|
|
private VideoPlayer videoPlayer;
|
|
private VideoPlayer videoPlayer;
|
|
- private Coroutine fadeCoroutine;
|
|
|
|
|
|
|
|
public void Show()
|
|
public void Show()
|
|
{
|
|
{
|
|
@@ -71,13 +69,15 @@ namespace GFGGame
|
|
private void OnVideoPrepared(VideoPlayer source)
|
|
private void OnVideoPrepared(VideoPlayer source)
|
|
{
|
|
{
|
|
videoPlayer.prepareCompleted -= OnVideoPrepared;
|
|
videoPlayer.prepareCompleted -= OnVideoPrepared;
|
|
- fadeCoroutine = StartCoroutine(FadeButtonOverTime());
|
|
|
|
|
|
+ StartCoroutine(FadeButtonOverTime(BtnFullScreen));
|
|
|
|
+ StartCoroutine(FadeButtonOverTime(BtnSkipVertical));
|
|
|
|
+ StartCoroutine(FadeButtonOverTime(BtnSkipHorizontal));
|
|
}
|
|
}
|
|
|
|
|
|
- IEnumerator FadeButtonOverTime()
|
|
|
|
|
|
+ IEnumerator FadeButtonOverTime(Button btn)
|
|
{
|
|
{
|
|
- Image buttonImage = BtnFullScreen.GetComponent<Image>();
|
|
|
|
- Text buttonText = BtnFullScreen.GetComponentInChildren<Text>();
|
|
|
|
|
|
+ Image buttonImage = btn.GetComponent<Image>();
|
|
|
|
+ Text buttonText = btn.GetComponentInChildren<Text>();
|
|
yield return new WaitForSeconds((float)videoPlayer.length - 3f);
|
|
yield return new WaitForSeconds((float)videoPlayer.length - 3f);
|
|
if (buttonImage != null)
|
|
if (buttonImage != null)
|
|
{
|
|
{
|
|
@@ -106,7 +106,6 @@ namespace GFGGame
|
|
buttonImage.color = targetColor;
|
|
buttonImage.color = targetColor;
|
|
buttonText.color = targetColorText;
|
|
buttonText.color = targetColorText;
|
|
}
|
|
}
|
|
- fadeCoroutine = null;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private void OnVideoEnded(VideoPlayer source)
|
|
private void OnVideoEnded(VideoPlayer source)
|
|
@@ -138,6 +137,7 @@ namespace GFGGame
|
|
|
|
|
|
public void Hide()
|
|
public void Hide()
|
|
{
|
|
{
|
|
|
|
+ StopAllCoroutines();
|
|
videoPlayer.Stop();
|
|
videoPlayer.Stop();
|
|
videoPlayer.loopPointReached -= OnVideoEnded;
|
|
videoPlayer.loopPointReached -= OnVideoEnded;
|
|
handle.Release();
|
|
handle.Release();
|