-
Notifications
You must be signed in to change notification settings - Fork 1
/
ExternalAssetInfo.cs
53 lines (46 loc) · 1.52 KB
/
ExternalAssetInfo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
namespace FortySevenE.ExternalAssetLoading
{
public enum ExternalAssetType
{
Unknown,
Image,
Video,
Audio
}
[Serializable]
public class ExternalAssetInfo
{
[JsonRequired] public string key;
[HideInInspector] [JsonIgnore] public ExternalAssetType type;
[JsonRequired] public string absPath;
}
public class GetAssetsRequest
{
public string folderPath;
public bool showLoadingGUI;
public Action<ExternalLoadedAssetCollection> onCompleted;
public GetAssetsRequest()
{
}
public GetAssetsRequest(string folderPath, bool showLoadingGUI, Action<ExternalLoadedAssetCollection> onCompleted)
{
this.folderPath = folderPath;
this.showLoadingGUI = showLoadingGUI;
this.onCompleted = onCompleted;
}
}
public class ExternalLoadedAssetCollection
{
public Dictionary<string, ExternalAssetInfo> allAvailableAssets = new Dictionary<string, ExternalAssetInfo>();
public Dictionary<string, Texture2D> preLoadedTextures = new Dictionary<string, Texture2D>();
public Dictionary<string, AudioClip> preLoadedAudioClips = new Dictionary<string, AudioClip>();
public Dictionary<string, string> keyToAbsVideoPaths = new Dictionary<string, string>();
}
}