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); }
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)); }