37 lines
939 B
C#
37 lines
939 B
C#
using System;
|
|
using System.Threading;
|
|
using Stary.Evo;
|
|
using Stary.Evo.AudioCore;
|
|
using Stary.Evo.UIFarme;
|
|
using UnityEngine;
|
|
|
|
public interface IVideoSystem : ISystem
|
|
{
|
|
void PlayVideo(VideoPanel.VideoInfo info);
|
|
void StopVideo();
|
|
}
|
|
|
|
public class VideoSystem : AbstractSystem, IVideoSystem
|
|
{
|
|
private CancellationTokenSource _cancellationTokenSource;
|
|
protected override void OnInit()
|
|
{
|
|
_cancellationTokenSource = new CancellationTokenSource();
|
|
}
|
|
|
|
public override void Dispose()
|
|
{
|
|
}
|
|
|
|
public async void PlayVideo(VideoPanel.VideoInfo info)
|
|
{
|
|
AudioCoreManager.SetMusicVolume(2f, 0f);
|
|
await this.GetSystem<IPanelSystem>().PushQueue<VideoPanel>(packageName:"Main");
|
|
this.GetSystem<IPanelSystem>().SendPanelEvent(ModeType.VideoStart,info);
|
|
}
|
|
|
|
public void StopVideo()
|
|
{
|
|
this.GetSystem<IPanelSystem>().SendPanelEvent(ModeType.VideoEnd);
|
|
}
|
|
} |