예제 #1
0
        public void SaveToAsync <T>(T asset, string assetPath) where T : IAsset
        {
            if (!AssetHandlers.ContainsKey(typeof(T)))
            {
                this.Log($"Unsupported asset type ({typeof(T).Name}).");

                return;
            }

            AssetHandler <T> provider = (AssetHandler <T>)AssetHandlers[typeof(T)];

            provider.Save(asset, assetPath);
        }
예제 #2
0
        public T LoadFromAsync <T>(string path, params object[] args) where T : IAsset
        {
            if (!AssetHandlers.ContainsKey(typeof(T)))
            {
                this.Log($"Unsupported asset type ({typeof(T).Name}).");

                return(default(T));
            }

            AssetHandler <T> provider = (AssetHandler <T>)AssetHandlers[typeof(T)];

            return(provider.Load(path, args));
        }