private void OnLoadResourceAgentHelperLoadComplete(object sender, LoadResourceAgentHelperLoadCompleteEventArgs e) { AssetObject assetObject = null; if (m_Task.IsScene) { assetObject = m_ResourceLoader.m_AssetPool.Spawn(m_Task.AssetName); } if (assetObject == null) { object[] dependencyAssets = m_Task.GetDependencyAssets(); assetObject = AssetObject.Create(m_Task.AssetName, e.Asset, dependencyAssets, m_Task.ResourceObject.Target, m_ResourceHelper, m_ResourceLoader); m_ResourceLoader.m_AssetPool.Register(assetObject, true); m_ResourceLoader.m_AssetToResourceMap.Add(e.Asset, m_Task.ResourceObject.Target); foreach (object dependencyAsset in dependencyAssets) { object dependencyResource = null; if (m_ResourceLoader.m_AssetToResourceMap.TryGetValue(dependencyAsset, out dependencyResource)) { m_Task.ResourceObject.AddDependencyResource(dependencyResource); } else { throw new GameFrameworkException("Can not find dependency resource."); } } } s_LoadingAssetNames.Remove(m_Task.AssetName); OnAssetObjectReady(assetObject); }
public static List <AssetObject> GetPrefabs(string rootPath) { List <AssetObject> list = new List <AssetObject>(); FindDic(rootPath, ".prefab", delegate(string path) { var assetObj = AssetObject.Create <GameObject>(path); list.Add(assetObj); }); return(list); }
public static List <AssetObject> GetFbxImporters(string rootPath) { List <AssetObject> list = new List <AssetObject>(); FindDic(rootPath, ".fbx", delegate(string path) { var assetObj = AssetObject.Create <AssetImporter>(path); list.Add(assetObj); }); return(list); }
public static List <AssetObject> GetTextureImporters(string rootPath, string[] banDic = null) { List <AssetObject> list = new List <AssetObject>(); FindDic(rootPath, ".png;.tga;.psd", delegate(string path) { if (!InCludePath(path, banDic)) { var assetObj = AssetObject.Create <Texture>(path); list.Add(assetObj); } }); return(list); }
public static List <AssetObject> GetSourceSprites(string rootPath, string[] banDic = null) { List <AssetObject> list = new List <AssetObject>(); FindDic(rootPath, ".png", delegate(string path) { if (!InCludePath(path, banDic)) { var assetObj = AssetObject.Create <Sprite>(path); list.Add(assetObj); } }); return(list); }