Exemplo n.º 1
0
 private TextAsset LoadAssetInfoFromAssetDatabase
 (
     string assetName, AiukAppModuleSetting module
 )
 {
     return(null);
 }
Exemplo n.º 2
0
        public static AssetBundleManifest GetMainfest(AiukAppModuleSetting module)
        {
            if (ManiFestMap.ContainsKey(module.Token))
            {
                return(ManiFestMap[module.Token]);
            }

            var    helper = new AiukAppModuleHelper(module);
            string path   = string.Empty;

            if (AiukUnityUtility.IsEditorMode)
            {
                path = helper.AssetBundleMainDir +
                       string.Format("{0}_Main", module.Token);
            }

            if (AiukUnityUtility.IsPlayer)
            {
                path = helper.SandboxDir + string.Format("AssetBundle/{0}_Main/",
                                                         module.Token);
            }

            var manifest = AssetBundle.LoadFromFile(path).LoadAsset("AssetBundleManifest") as AssetBundleManifest;

            ManiFestMap.Add(module.Token, manifest);
            return(manifest);
        }
Exemplo n.º 3
0
        private TextAsset LoadAssetInfoFromSandbox(string assetName, AiukAppModuleSetting module)
        {
            var sandboxPath = Application.persistentDataPath + string.Format(
                "/{0}/{1}/AssetBundle/Binary/{2}.assetbundle"
                , module.AppName, module.Token, assetName);

            var bundle    = AssetBundle.LoadFromFile(sandboxPath);
            var textAsset = bundle.LoadAsset <TextAsset>(assetName);

            return(textAsset);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 添加一个新的应用模块。
        /// </summary>
        /// <param name="module">Module.</param>
        public void AddModule(AiukAppModuleSetting module)
        {
            if (IsExist(module.Name))
            {
                AiukDebugUtility.LogError(
                    string.Format("目标模块{0}已存在,添加失败!", module.Name));
                return;
            }

            AppModules.Add(module);
            CurrentModuleName = module.Name;
        }
Exemplo n.º 5
0
        public AiukAppSetting
        (
            string organizationName,
            string appName,
            string rootDir)
        {
            OrganizationName = organizationName;
            Name             = appName;
            RootDir          = rootDir;

            var shareModule = new AiukAppModuleSetting(this, "Share");

            AddModule(shareModule);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 添加一个将要启动的应用模块。
        /// </summary>
        /// <returns>The app module.</returns>
        /// <param name="module">Module.</param>
        public AiukUnityApp SetAppModule(AiukAppModuleSetting module)
        {
            var exist = AppModules.Find(m => m.Token == module.Token);

            if (exist != null)
            {
                AiukDebugUtility.LogError(
                    string.Format("目标模块设置{0}当前已存在!", module.Token));
                return(this);
            }

            AppModules.Add(module);
            return(this);
        }
Exemplo n.º 7
0
        public AiukAssetInfo
        (
            AiukAppModuleSetting module,
            string assetName,
            string fullPath
        )
        {
            AssetName = assetName;
            LocModule = module.Name;
            var helper = new AiukAppModuleHelper(module);

            Type = fullPath.Replace(helper.AssetDatabaseRootDir, "")
                   .Split('/').First();
            RelativePath = fullPath.Replace(helper.AssetDatabaseRootDir, "")
                           .Split('.').First();
            ImporterPath = AiukUnityIOUtility.GetImporterPath(fullPath);
        }
Exemplo n.º 8
0
        private Dictionary <string, T> LoadAssetInfo <T>
        (
            string assetName,
            AiukAppModuleSetting module
        )
        {
            var textAsset = App.RunSetting.LoadFromAssetBundle ?
                            LoadAssetInfoFromSandbox(assetName, module) :
                            LoadAssetInfoFromAssetDatabase(assetName, module);

            if (textAsset == null)
            {
                throw new AiukAssetInfoLoadFailException(
                          string.Format("目标资源数据{0}加载失败", assetName));
            }

            var infos = AiukSerializeUtility.DeSerialize <Dictionary <string, T> >(textAsset.bytes);

            return(infos);
        }
Exemplo n.º 9
0
 public AiukAppModuleHelper(AiukAppModuleSetting appModule)
 {
     m_AppModule = appModule;
 }
Exemplo n.º 10
0
        private void GetBundleName(string type, AiukAppModuleSetting module)
        {
            var assetSetting = module.GetAssetSetting(type);

            BundleName = assetSetting.IsSingle ? AssetName.ToLower() : type.ToLower();
        }