using System; using System.Collections.Generic; using RenderHeads.Media.AVProVideo; using UnityEngine; namespace NBF { public class Game : MonoBehaviour { public static Game Instance { get; private set; } public readonly List Videos = new List(); public int Page = 1; public int PageSize = 100; private void Awake() { Instance = this; } public void Tick(Action callback = null) { var dic = new Dictionary { { "device", PlatformInfo.GetAndroidID() }, { "deviceName", "android" }, { "id", "0" }, { "time", "0" } }; Net.Instance.Send("/api/device", dic, result => { callback?.Invoke(result.Code == 0); }); } public void GetList(Action callback) { var dic = new Dictionary { { "page", Page.ToString() }, { "PageSize", PageSize.ToString() } }; Net.Instance.Send("/api/list", dic, result => { ParseVideo(result); callback?.Invoke(); }); } private void ParseVideo(HttpResult httpResult) { if (httpResult.Code != 0) return; var retData = httpResult.Data.ToObject>(); } } }