Files
P2SinNext/Assets/Code/VideoPlayer.cs
2025-10-19 19:04:50 +05:00

24 lines
607 B
C#

using System.Collections;
using UnityEngine;
public class VideoPlayer : MonoBehaviour
{
public void PlayVideo(int videoId, ScriptCommand cmd)
{
// Ñòàâèì âèäåî íà âîñïðîèçâåäåíèå
Debug.Log($"Playing video: {videoId}");
// Ñèìóëÿöèÿ async âûïîëíåíèÿ
StartCoroutine(PlayVideoCoroutine(cmd));
}
private IEnumerator PlayVideoCoroutine(ScriptCommand cmd)
{
// Çàãëóøêà - æäåì 2 ñåêóíäû êàê áóäòî âèäåî èãðàåò
yield return new WaitForSeconds(2f);
// Ïîìå÷àåì êîìàíäó êàê âûïîëíåííóþ
App.VM.MarkCommandCompleted(cmd);
}
}