Exemple #1
0
        public void LoadScene(string bundleName, string assetName, bool isAdditive)
        {
            string bundleNameWithVariant;

            if (LoadAssetBundle(bundleName, out bundleNameWithVariant) != AssetBundleStatus.Failed)
            {
                var warehouse = FindWarehouse(bundleName, _defaultWarehouse);
                _assetsWaitForBundle.AddLastExt(warehouse.LoadScene(bundleNameWithVariant, assetName, isAdditive));
            }
            else
            {
                _assetsWaitForBundle.AddLastExt(AssetBundleWarehouse.LoadFailed(AssetLoadingPattern.Unkown, true, bundleName, assetName, null));
            }
        }
Exemple #2
0
        public void LoadAsset(string bundleName, string assetName, Type ObjectType)
        {
            string bundleNameWithVariant;
            AssetLoadingPattern LoadingPattern = AssetLoadingPattern.Unkown;

            if (LoadAssetBundle(bundleName, out bundleNameWithVariant) != AssetBundleStatus.Failed)
            {
                var warehouse    = FindWarehouse(bundleName, _defaultWarehouse);
                var assetLoading = warehouse.LoadAsset(bundleNameWithVariant, assetName, ObjectType);
                if (warehouse is SimulationWarehouse)
                {
                    LoadingPattern = AssetLoadingPattern.Simulation;
                }
                if (assetLoading != null)
                {
                    _assetsWaitForBundle.AddLastExt(assetLoading);
                    return;
                }
            }

            _assetsWaitForBundle.AddLastExt(AssetBundleWarehouse.LoadFailed(LoadingPattern, false, bundleName, assetName, ObjectType));
        }