39 lines
963 B
C#
39 lines
963 B
C#
using DG.Tweening;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.Video;
|
|
|
|
public class LoadingPanel : MonoBehaviour
|
|
{
|
|
public VideoPlayer player;
|
|
public Image image_Bg;
|
|
public Action actionEnd;
|
|
public float fadeTime = 1.3f;
|
|
/// <summary>
|
|
/// 进入条进度值
|
|
/// </summary>
|
|
/// <param name="count">最大100 100时直接删除</param>
|
|
public void LoadBar(int count)
|
|
{
|
|
if (count == 100)
|
|
{
|
|
GameManager.Instance.btn_Skip.gameObject.SetActive(false);
|
|
Destroy(gameObject, fadeTime);
|
|
if (player.gameObject.activeSelf)
|
|
{
|
|
player.GetComponent<RawImage>().DOFade(0, fadeTime);
|
|
}
|
|
if (image_Bg.gameObject.activeSelf)
|
|
{
|
|
image_Bg.DOFade(0, fadeTime);
|
|
|
|
}
|
|
actionEnd?.Invoke();
|
|
}
|
|
|
|
}
|
|
}
|