private void GenericRequest <T>(string key, ContentReceiveHandler <T> onResult) where T : UnityEngine.Object { var asset = Resources.Load <T>(key); if (asset == null) { onResult(key, ContentReceiveResult <T> .Error($"Content ({key}) not found")); } else { onResult(key, ContentReceiveResult <T> .Success(asset)); } }
public void RequestXml(string key, ContentReceiveHandler <string> onResult) { var xmlAsset = Resources.Load <TextAsset>(key); onResult(key, ContentReceiveResult <string> .Success(xmlAsset.text)); }