コード例 #1
0
ファイル: JsonDevice.cs プロジェクト: smdx24/CPI-Source-Code
        public override TAsset LoadImmediate <TAsset>(string deviceList, ref ContentManifest.AssetEntry entry)
        {
            string      stringToDeserialize = DeviceManager.LoadImmediate <string>(deviceList, ref entry);
            JsonService jsonService         = Service.Get <JsonService>();

            return(jsonService.Deserialize <TAsset>(stringToDeserialize));
        }
コード例 #2
0
ファイル: JsonDevice.cs プロジェクト: smdx24/CPI-Source-Code
        private IEnumerator waitForStringToLoad <TAsset>(AsyncAssetRequest <TAsset> assetRequest, AssetRequest <string> stringRequest, string key, AssetLoadedHandler <TAsset> handler) where TAsset : class
        {
            yield return(stringRequest);

            string      jsonString = stringRequest.Asset;
            JsonService json       = Service.Get <JsonService>();
            TAsset      jsonAsset  = json.Deserialize <TAsset>(jsonString);

            assetRequest.Request = new IndexedAssetRequest <TAsset>(key, jsonAsset);
            handler?.Invoke(key, jsonAsset);
        }