Ejemplo n.º 1
0
        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));
            }
        }
Ejemplo n.º 2
0
        public void RequestXml(string key, ContentReceiveHandler <string> onResult)
        {
            var xmlAsset = Resources.Load <TextAsset>(key);

            onResult(key, ContentReceiveResult <string> .Success(xmlAsset.text));
        }