24 lines
607 B
C#
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);
|
|
}
|
|
} |