1
This commit is contained in:
@@ -6,13 +6,32 @@ using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.Video;
|
||||
|
||||
public class LoadingPanel : MonoBehaviour
|
||||
public class LoadingPanel : MonoBehaviour, ILoadingPanel
|
||||
{
|
||||
public VideoPlayer player;
|
||||
public Image image_Bg;
|
||||
public Action actionEnd;
|
||||
public float fadeTime = 1.3f;
|
||||
|
||||
/// <summary>设置并播放过场视频</summary>
|
||||
public void PlayVideo(VideoClip clip)
|
||||
{
|
||||
player.clip = clip;
|
||||
player.Play();
|
||||
}
|
||||
|
||||
/// <summary>设置背景图</summary>
|
||||
public void SetBackground(Sprite sprite)
|
||||
{
|
||||
image_Bg.sprite = sprite;
|
||||
}
|
||||
|
||||
/// <summary>注册播放结束回调</summary>
|
||||
public void SetOnEnd(Action action)
|
||||
{
|
||||
actionEnd = action;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// ⭐ 视频播放期间预载大厅主面板:把 HomeUIRes 的加载提前到这段视频等待时间里,
|
||||
|
||||
Reference in New Issue
Block a user