//複数のAssetBundleを並行して取得する場合 public void OnClickMultiple() { Reset(); AssetBundlerMultiplier multiplier = AssetBundlerMultiplier.Create(); multiplier.Add(AssetBundler.Create().Set("iconpackpanel", (o) => { image01.sprite = o.GetSprites()[0]; // image01.sprite = o.GetAsset<>() })).Load(); multiplier.Add(AssetBundler.Create().SetAsUnitTexture(unitId, (o) => { rawImage.texture = o.GetTexture2D(TextureWrapMode.Clamp); })).Load(); multiplier.Load(() => { #if BUILD_TYPE_DEBUG Debug.Log("FINISH"); #endif }, () => { #if BUILD_TYPE_DEBUG Debug.Log("ERROR"); #endif }); }
private IEnumerator LoadIcon(System.Action finish) { AssetBundlerMultiplier multi = AssetBundlerMultiplier.Create(); yield return(UnitIconImageProvider.Instance.LoadIconPacks(multi)); multi.Load(finish); }
IEnumerator CreateLoadResource(Action <AssetBundlerMultiplier> finishAction, List <int> categories = null) { AssetBundlerMultiplier mlutiplier = AssetBundlerMultiplier.Create(); if (categories != null && categories.Count > 0) { for (int i = 0; i < categories.Count; i++) { List <MasterDataAssetBundlePath> assetBundlePathList = MasterFinder <MasterDataAssetBundlePath> .Instance. SelectWhere(" where category = ? ", categories[i]); #if BUILD_TYPE_DEBUG Debug.Log("CALL SceneTitle#LoadTitleDownload Count:" + assetBundlePathList.Count); #endif yield return(null); for (int j = 0; j < assetBundlePathList.Count; j++) { AssetBundler aber = AssetBundler.Create().Set(assetBundlePathList[j].name.ToLower()).SkipCreateCache(); mlutiplier.Add(aber); yield return(null); } ; } yield return(null); } yield return(UnitIconImageProvider.Instance.LoadIconPacks(mlutiplier)); yield return(null); yield return(ReplaceAssetManager.Instance.downloadReplaceAssetbundle(mlutiplier)); yield return(null); yield return(AreaBackgroundProvider.Instance.PreLoadAreaBackground(mlutiplier)); yield return(null); yield return(GeneralWindowProvider.Instance.PreLoad(mlutiplier)); yield return(null); mlutiplier.RegisterProgressAction( (float progress) => { float progressPercent = progress * 100; LoadingManager.Instance.Progress(progressPercent); if (MovieManager.Instance != null) { MovieManager.Instance.setPercent(progressPercent); } }); finishAction(mlutiplier); }
public void setup(uint select_event_id = 0) { m_AssetBundleMulti = AssetBundlerMultiplier.Create(); //3DTest //initChallengeBoss(boss_ids); initButton(); // initBossData(select_event_id); if (assetAutoSetEpisodeBackgroundTexture != null) { m_AssetBundleMulti .Add(LoadBackgroundTexture()); } m_AssetBundleMulti.Load( () => { // float movePos = BOSS_POS_OFFSET * (BossIconList.Count - m_SelectIndex - 1); RectTransform trans = BossRoot.GetComponent <RectTransform>(); trans.anchoredPosition = new Vector2(movePos, trans.anchoredPosition.y); BossPanelImage.DOColor(new Color(1, 1, 1, 1), BOSS_PANEL_ANIMATION_TIME); Panel.DOScaleY(1.0f, BOSS_PANEL_ANIMATION_TIME) .OnComplete(() => { //ボタン有効化 for (int i = 0; i < BossIconList.Count; i++) { BossIconList[i].model.Appear(); } for (int i = 0; i < m_buttonModels.Count; i++) { m_buttonModels[i].Appear(); } updateButton(); //ボス変更コールバック OnChengedBoss(m_Events[m_SelectIndex]); m_bReady = true; }); }); }
public static void PlayBGM(string asset_bundle_name, string bgm_asset_name, bool is_fade, List <string> bgm_asset_name_list = null) { if (bgm_asset_name_list != null) { bool is_exist_intro = false; bool is_exist_body = false; bool is_cross_fade_intro = false; for (int idx = 0; idx < bgm_asset_name_list.Count; idx++) { string work_bgm_asset_name = bgm_asset_name_list[idx]; if (is_exist_intro == false) { if (work_bgm_asset_name == bgm_asset_name + "i") { is_exist_intro = true; is_cross_fade_intro = false; } else if (work_bgm_asset_name == bgm_asset_name + "j") { is_exist_intro = true; is_cross_fade_intro = true; } } if (is_exist_body == false && work_bgm_asset_name == bgm_asset_name ) { is_exist_body = true; } } if (is_exist_body || is_exist_intro) { AudioClip audio_clip_intro = null; AudioClip audio_clip_body = null; AssetBundlerMultiplier assetbundler_multiplier = AssetBundlerMultiplier.Create(); if (is_exist_intro) { string intro_asset_name; if (is_cross_fade_intro) { intro_asset_name = bgm_asset_name + "j"; } else { intro_asset_name = bgm_asset_name + "i"; } assetbundler_multiplier.Add( AssetBundler.Create() .SetAsAudioClip(asset_bundle_name, intro_asset_name, (o) => { audio_clip_intro = o; } ) ); } if (is_exist_body) { assetbundler_multiplier.Add( AssetBundler.Create() .SetAsAudioClip(asset_bundle_name, bgm_asset_name, (o) => { audio_clip_body = o; } ) ); } assetbundler_multiplier.Load( () => { // BGM再生 _PlayBattleBgmSub(audio_clip_intro, audio_clip_body, is_fade, is_cross_fade_intro); } ); } } else { // データを読み込み AssetBundler.Create().SetAsAudioClipPack(asset_bundle_name , (clips) => { AudioClip audio_clip_intro = null; AudioClip audio_clip_body = null; bool is_cross_fade_intro = false; for (int idx = 0; idx < clips.Count; idx++) { // イントロ部分のデータ if (audio_clip_intro == null) { if (clips[idx].name == bgm_asset_name + "j") { // クロスフェード用1秒ありのイントロデータ(v400は主にこちらの方式を使っている模様) audio_clip_intro = clips[idx]; is_cross_fade_intro = true; } else if (clips[idx].name == bgm_asset_name + "i") { // イントロデータ(通常のイントロデータ) audio_clip_intro = clips[idx]; } } // ループ部分のデータ if (audio_clip_body == null) { if (clips[idx].name == bgm_asset_name) { audio_clip_body = clips[idx]; } } } // BGM再生 _PlayBattleBgmSub(audio_clip_intro, audio_clip_body, is_fade, is_cross_fade_intro); } , (str) => { } ).Load(); } }
private void setupEvol() { if (m_bEvolve) { m_EvolveList.Clear(); m_UnitEvolvePanel.EvolveList.Clear(); AndroidBackKeyManager.Instance.DisableBackKey(); new SerialProcess().Add( (System.Action next) => { //最初の進化先 int nextUnitId = (int)m_UnitId; MasterDataParamChara _masterAfter = m_MainUnitMaster; bool nameView = false; //進化先がなくなるまで追加処理 do { MasterDataParamCharaEvol _evolAfter = MasterDataUtil.GetCharaEvolParamFromCharaID((uint)nextUnitId); EvolveInfo evolveInfo = new EvolveInfo(); evolveInfo.charaMaster = _masterAfter; evolveInfo.evolveMaster = _evolAfter; evolveInfo.charaTexture = null; evolveInfo.nameView = nameView; m_EvolveList.Add(evolveInfo); nameView = true; nextUnitId = -1; if (_evolAfter != null) { _masterAfter = MasterFinder <MasterDataParamChara> .Instance.Find((int)_evolAfter.unit_id_after); if (_masterAfter != null) { nextUnitId = (int)_evolAfter.unit_id_after; } } //同一キャラがすでにリストに登録されていたら検索をやめる if (nextUnitId != -1 && checkEvolveCharaID((uint)nextUnitId) == false) { nextUnitId = -1; } } while (nextUnitId != -1); //ローディング表示開始 LoadingManager.Instance.RequestLoadingStart(LOADING_TYPE.GUARD); next(); }) .Add((System.Action next) => { AssetBundlerMultiplier multi = AssetBundlerMultiplier.Create(); for (int i = 0; i < m_EvolveList.Count; i++) { int no = i; AssetBundler assetBundler = AssetBundler.Create() .SetAsUnitTexture(m_EvolveList[i].charaMaster.fix_id, (o) => { m_EvolveList[no].charaTexture = o.GetTexture2D(TextureWrapMode.Clamp); }); multi.Add(assetBundler); } multi.Load( () =>//Success { next(); }, () =>//Error { next(); }); }) .Add((System.Action next) => { for (int i = 0; i < m_EvolveList.Count; i++) { UnitEvolveContext evolveContext = new UnitEvolveContext(); evolveContext.setup(m_EvolveList[i].charaMaster, m_EvolveList[i].evolveMaster, m_EvolveList[i].charaTexture, m_EvolveList[i].nameView); evolveContext.DidSelectItem = OnSelectSkillButton; m_UnitEvolvePanel.EvolveList.Add(evolveContext); } //ローディング表示終了 LoadingManager.Instance.RequestLoadingFinish(LOADING_TYPE.GUARD); AndroidBackKeyManager.Instance.EnableBackKey(); m_LastUpdateCount = UPDATE_LAYOUT_COUNT; next(); }) .Flush(); } m_Setup[(int)ToggleType.Evolve] = true; }
void SelectArea(/*MasterDataDefineLabel.AreaCategory[] areaCategoryArray*/) { m_CurrentRegionMaster = MasterFinder <MasterDataRegion> .Instance.Find((int)MainMenuParam.m_RegionID); if (m_CurrentRegionMaster != null) { m_RegionMasterList = MainMenuUtil.CreateRegionList(m_CurrentRegionMaster.category); if (m_RegionMasterList.IsNullOrEmpty() == false) { if (m_RegionMasterList.Contains(m_CurrentRegionMaster) == false) { // 開催期間が切れた等で有効なデータが無い場合 ResidentParam.m_RegionIds[(int)m_CurrentRegionMaster.category] = 0; openWarningRegionDialog(); return; } } } MasterDataAreaCategory[] areaCategoryMasterArray = null; List <AreaDataContext> areaDataList = new List <AreaDataContext>(); new SerialProcess() .Add(next => { // インジケーターを表示 LoadingManager.Instance.RequestLoadingStart(LOADING_TYPE.ASSETBUNDLE); if (m_CurrentRegionMaster != null) { m_AreaSelect.IsViewRegionButton = (m_RegionMasterList != null && m_RegionMasterList.Count > 1); ResidentParam.m_RegionIds[(int)m_CurrentRegionMaster.category] = m_CurrentRegionMaster.fix_id; areaCategoryMasterArray = MasterFinder <MasterDataAreaCategory> .Instance.SelectWhere("where region_id = ?", MainMenuParam.m_RegionID).ToArray(); // Region ID毎の背景画像をAssetBundleからセットする. // AssetBundlePathMasterに該当のAssetBundleがあるか確認し, なければデフォルト画像を表示する. SetAreaBackground(m_CurrentRegionMaster.category, m_CurrentRegionMaster.fix_id, next); switch (m_CurrentRegionMaster.category) { case MasterDataDefineLabel.REGION_CATEGORY.STORY: m_AreaSelect.currentCategory = MasterDataDefineLabel.AreaCategory.RN_STORY; MainMenuHeader.UnderMsgRequest(GameTextUtil.GetText("kk99p_description")); break; case MasterDataDefineLabel.REGION_CATEGORY.MATERIAL: m_AreaSelect.currentCategory = MasterDataDefineLabel.AreaCategory.RN_SCHOOL; MainMenuHeader.UnderMsgRequest(GameTextUtil.GetText("kk101p_description")); break; case MasterDataDefineLabel.REGION_CATEGORY.EVENT: m_AreaSelect.currentCategory = MasterDataDefineLabel.AreaCategory.RN_EVENT; MainMenuHeader.UnderMsgRequest(GameTextUtil.GetText("kk100p_description")); break; default: break; } } else { //MasterDataRegionがなかった時のセーフティ(データが設定されていないサーバーに接続した場合) #if BUILD_TYPE_DEBUG string messageText = "MasterDataRegionに有効なデータがありませんでした。\n" + "プランナーさんにマスターデータ設定が\n間違っていないか確認しください。\n" + "\n不明な場合は\nクライアントプログラマに報告してください。"; Dialog dloalog = DialogManager.Open1B_Direct("No MasterDataRegion", messageText, "common_button7", true, true) .SetOkEvent(() => { }); #endif m_AreaSelect.IsViewRegionButton = false; if (m_AreaCategory == null) { m_AreaCategory = new MasterDataDefineLabel.AreaCategory[] { MasterDataDefineLabel.AreaCategory.RN_STORY }; } string sqlInString = string.Join(",", Array.ConvertAll <MasterDataDefineLabel.AreaCategory, string>(m_AreaCategory, o => o.ToString("D"))); areaCategoryMasterArray = MasterFinder <MasterDataAreaCategory> .Instance.SelectWhere(string.Format(" where area_cate_type in( {0} )", sqlInString)).ToArray(); // 背景のリソース設定 if (0 <= Array.IndexOf(m_AreaCategory, MasterDataDefineLabel.AreaCategory.RN_STORY)) { m_AreaSelect.BackGroundImage = m_AreaSelect.backgroundSprites[0]; m_AreaSelect.currentCategory = MasterDataDefineLabel.AreaCategory.RN_STORY; MainMenuHeader.UnderMsgRequest(GameTextUtil.GetText("kk99p_description")); } else if (0 <= Array.IndexOf(m_AreaCategory, MasterDataDefineLabel.AreaCategory.RN_SCHOOL)) { m_AreaSelect.BackGroundImage = m_AreaSelect.backgroundSprites[1]; m_AreaSelect.currentCategory = MasterDataDefineLabel.AreaCategory.RN_SCHOOL; MainMenuHeader.UnderMsgRequest(GameTextUtil.GetText("kk101p_description")); } else if (0 <= Array.IndexOf(m_AreaCategory, MasterDataDefineLabel.AreaCategory.RN_EVENT)) { m_AreaSelect.BackGroundImage = m_AreaSelect.backgroundSprites[2]; m_AreaSelect.currentCategory = MasterDataDefineLabel.AreaCategory.RN_EVENT; MainMenuHeader.UnderMsgRequest(GameTextUtil.GetText("kk100p_description")); } // エリアアイコン読み込みに遷移. next(); } }).Add(next => { // エリアカテゴリリストの生成 m_AreaSelect.ClearAreaData(); m_areaIcons.Clear(); AssetBundlerMultiplier multiplier = AssetBundlerMultiplier.Create(); if (areaCategoryMasterArray != null) { for (int i = 0; i < areaCategoryMasterArray.Length; ++i) { string area_title = areaCategoryMasterArray[i].area_cate_name; uint area_cate_id = areaCategoryMasterArray[i].fix_id; Vector2 area_pos = new Vector2(areaCategoryMasterArray[i].btn_posx_offset, areaCategoryMasterArray[i].btn_posy_offset * -1); int index = m_areaIcons.Count; // areaCategoryMasterArrayのうち不採用のデータがあるので・・・ var model = makeAreaSelectModel(index, area_cate_id); AreaDataContext newArea = MainMenuUtil.CreateRNAreaCategory(area_cate_id, model); if (newArea != null) { newArea.Title = area_title; newArea.PosX = area_pos.x; newArea.PosY = area_pos.y; // アセットバンドルの読み込み string assetBundleName = string.Format("areamapicon_{0}", area_cate_id); multiplier.Add(AssetBundler.Create(). Set(assetBundleName, (o) => { newArea.IconImage = o.GetAsset <Sprite>(); newArea.IconImage_mask = o.GetTexture(newArea.IconImage.name + "_mask", TextureWrapMode.Clamp); }, (s) => { newArea.IconImage = ResourceManager.Instance.Load("maeishoku_icon"); }).Load()); areaDataList.Add(newArea); m_areaIcons.Add(model); } } //成長ボスアイコン if (m_CurrentRegionMaster.category == MasterDataDefineLabel.REGION_CATEGORY.EVENT && m_ChallengeAreaCategory != null) { uint area_cate_id = m_ChallengeAreaCategory.fix_id; Vector2 area_pos = new Vector2(m_ChallengeAreaCategory.btn_posx_offset, m_ChallengeAreaCategory.btn_posy_offset * -1); int index = m_areaIcons.Count; // areaCategoryMasterArrayのうち不採用のデータがあるので・・・ var model = makeAreaSelectModel(index, area_cate_id, true); model.isChallenge = true; AreaDataContext newArea = new AreaDataContext(model); newArea.m_AreaIndex = m_ChallengeAreaCategory.fix_id; newArea.IsViewFlag = false; //newArea.FlagImage = ResourceManager.Instance.Load("completed"); //newArea.FlagImage = ResourceManager.Instance.Load("clear"); newArea.IsAreaNew = false; newArea.Title = GameTextUtil.GetText("challenge_quest_title"); newArea.PosX = area_pos.x; newArea.PosY = area_pos.y; newArea.m_bufEvent = MainMenuUtil.IsCheckChallengeAmend(); // アセットバンドルの読み込み string assetBundleName = string.Format("areamapicon_{0}", area_cate_id); multiplier.Add(AssetBundler.Create(). Set(assetBundleName, (o) => { newArea.IconImage = o.GetAsset <Sprite>(); newArea.IconImage_mask = o.GetTexture(newArea.IconImage.name + "_mask", TextureWrapMode.Clamp); }, (s) => { newArea.IconImage = ResourceManager.Instance.Load("maeishoku_icon"); }).Load()); areaDataList.Add(newArea); m_areaIcons.Add(model); } } #if BUILD_TYPE_DEBUG else if (m_CurrentRegionMaster != null) { // MasterDataAreaCategory がなかった時のエラーダイアログ. string messageText = "MasterDataAreaCategory に\n有効なデータがありませんでした。\n" + "プランナーさんにマスターデータ設定が\n間違っていないか確認してください。\n" + "\n不明な場合は\nクライアントプログラマに報告してください。"; Dialog dloalog = DialogManager.Open1B_Direct("No MasterDataAreaCategory", messageText, "common_button7", true, true) .SetOkEvent(() => { }); } #endif multiplier.Load(() => { next(); }, () => { // エリアアイコンで読み込み出来ないものがあった場合も、 // 仮アイコンが設定されるため、アイコンリストを表示する.(進行不能対策) next(); }); }).Add(next => { SetAreaIconRoutine(areaDataList); m_AreaSelect.checkAnimationFinish(); // インジケーターを閉じる LoadingManager.Instance.RequestLoadingFinish(LOADING_TYPE.ASSETBUNDLE); }).Flush(); }
/// <summary> /// 主人公リストの設定 /// </summary> static public List <HeroFormListContext> CreateFormDatas(Action <HeroFormListContext> _OnClickFaceImageAction, Action <List <HeroFormListContext> > finishLoadAssetBundleAction, Action _finishSelectHero) { List <HeroFormListContext> datas = new List <HeroFormListContext>(); for (int i = 0; i < 6; i++) { HeroFormListContext data = new HeroFormListContext(); data.OnClickFaceImageAction = _OnClickFaceImageAction; datas.Add(data); } finishSelectHero = _finishSelectHero; //----------------------------------------------------------- // 職種 //----------------------------------------------------------- datas[0].Job = HeroFormListContext.JobType.STUDENT; datas[1].Job = HeroFormListContext.JobType.STUDENT; datas[2].Job = HeroFormListContext.JobType.STUDENT; datas[3].Job = HeroFormListContext.JobType.STUDENT; datas[4].Job = HeroFormListContext.JobType.TEACHER; datas[5].Job = HeroFormListContext.JobType.STUDENT; //----------------------------------------------------------- // アセットバンドルの読み込み //----------------------------------------------------------- // インジケーターを表示 if (LoadingManager.Instance != null) { LoadingManager.Instance.RequestLoadingStart(LOADING_TYPE.ASSETBUNDLE); } AssetBundlerMultiplier multiplier = AssetBundlerMultiplier.Create(); multiplier.Add(AssetBundler.Create().Set("hero_0001", "hero_0001", (o) => { Sprite[] sprite = o.AssetBundle.LoadAssetWithSubAssets <Sprite>("hero_0001"); datas[0].FaceImage = sprite[(int)Hero_0001_Sprite_Tag.Face]; datas[0].NameImage = sprite[(int)Hero_0001_Sprite_Tag.Name]; datas[0].BirthdayImage = sprite[(int)Hero_0001_Sprite_Tag.Birthday]; datas[0].NumberImage = sprite[(int)Hero_0001_Sprite_Tag.No]; Texture maskTextue = o.GetTexture("hero_0001_mask", TextureWrapMode.Clamp); datas[0].NameImage_mask = maskTextue; datas[0].BirthdayImage_mask = maskTextue; datas[0].NumberImage_mask = maskTextue; datas[0].HeroIndex = 1; })); multiplier.Add(AssetBundler.Create().Set("hero_0002", "hero_0002", (o) => { Sprite[] sprite = o.AssetBundle.LoadAssetWithSubAssets <Sprite>("hero_0002"); datas[1].FaceImage = sprite[(int)Hero_0002_Sprite_Tag.Face]; datas[1].NameImage = sprite[(int)Hero_0002_Sprite_Tag.Name]; datas[1].BirthdayImage = sprite[(int)Hero_0002_Sprite_Tag.Birthday]; datas[1].NumberImage = sprite[(int)Hero_0002_Sprite_Tag.No]; Texture maskTextue = o.GetTexture("hero_0002_mask", TextureWrapMode.Clamp); datas[1].NameImage_mask = maskTextue; datas[1].BirthdayImage_mask = maskTextue; datas[1].NumberImage_mask = maskTextue; datas[1].HeroIndex = 2; })); multiplier.Add(AssetBundler.Create().Set("hero_0003", "hero_0003", (o) => { Sprite[] sprite = o.AssetBundle.LoadAssetWithSubAssets <Sprite>("hero_0003"); datas[2].FaceImage = sprite[(int)Hero_0003_Sprite_Tag.Face]; datas[2].NameImage = sprite[(int)Hero_0003_Sprite_Tag.Name]; datas[2].BirthdayImage = sprite[(int)Hero_0003_Sprite_Tag.Birthday]; datas[2].NumberImage = sprite[(int)Hero_0003_Sprite_Tag.No]; Texture maskTextue = o.GetTexture("hero_0003_mask", TextureWrapMode.Clamp); datas[2].NameImage_mask = maskTextue; datas[2].BirthdayImage_mask = maskTextue; datas[2].NumberImage_mask = maskTextue; datas[2].HeroIndex = 3; })); multiplier.Add(AssetBundler.Create().Set("hero_0004", "hero_0004", (o) => { Sprite[] sprite = o.AssetBundle.LoadAssetWithSubAssets <Sprite>("hero_0004"); datas[3].FaceImage = sprite[(int)Hero_0004_Sprite_Tag.Face]; datas[3].NameImage = sprite[(int)Hero_0004_Sprite_Tag.Name]; datas[3].BirthdayImage = sprite[(int)Hero_0004_Sprite_Tag.Birthday]; datas[3].NumberImage = sprite[(int)Hero_0004_Sprite_Tag.No]; Texture maskTextue = o.GetTexture("hero_0004_mask", TextureWrapMode.Clamp); datas[3].NameImage_mask = maskTextue; datas[3].BirthdayImage_mask = maskTextue; datas[3].NumberImage_mask = maskTextue; datas[3].HeroIndex = 4; })); multiplier.Add(AssetBundler.Create().Set("hero_0005", "hero_0005", (o) => { Sprite[] sprite = o.AssetBundle.LoadAssetWithSubAssets <Sprite>("hero_0005"); datas[4].FaceImage = sprite[(int)Hero_0005_Sprite_Tag.Face]; datas[4].NameImage = sprite[(int)Hero_0005_Sprite_Tag.Name]; datas[4].BirthdayImage = sprite[(int)Hero_0005_Sprite_Tag.Birthday]; datas[4].NumberImage = sprite[(int)Hero_0005_Sprite_Tag.No]; Texture maskTextue = o.GetTexture("hero_0005_mask", TextureWrapMode.Clamp); datas[4].NameImage_mask = maskTextue; datas[4].BirthdayImage_mask = maskTextue; datas[4].NumberImage_mask = maskTextue; datas[4].HeroIndex = 5; })); multiplier.Add(AssetBundler.Create().Set("hero_0006", "hero_0006", (o) => { Sprite[] sprite = o.AssetBundle.LoadAssetWithSubAssets <Sprite>("hero_0006"); datas[5].FaceImage = sprite[(int)Hero_0006_Sprite_Tag.Face]; datas[5].NameImage = sprite[(int)Hero_0006_Sprite_Tag.Name]; datas[5].BirthdayImage = sprite[(int)Hero_0006_Sprite_Tag.Birthday]; datas[5].NumberImage = sprite[(int)Hero_0006_Sprite_Tag.No]; Texture maskTextue = o.GetTexture("hero_0006_mask", TextureWrapMode.Clamp); datas[5].NameImage_mask = maskTextue; datas[5].BirthdayImage_mask = maskTextue; datas[5].NumberImage_mask = maskTextue; datas[5].HeroIndex = 6; })); multiplier.Load(() => { if (finishLoadAssetBundleAction != null) { finishLoadAssetBundleAction(datas); } // インジケーターを閉じる if (LoadingManager.Instance != null) { LoadingManager.Instance.RequestLoadingFinish(LOADING_TYPE.ASSETBUNDLE); } }, () => { // インジケーターを閉じる if (LoadingManager.Instance != null) { LoadingManager.Instance.RequestLoadingFinish(LOADING_TYPE.ASSETBUNDLE); } }); //----------------------------------------------------------- // 学年 //----------------------------------------------------------- datas[0].SchoolYearImage = ResourceManager.Instance.Load("gakunen_2"); datas[1].SchoolYearImage = ResourceManager.Instance.Load("gakunen_2"); datas[2].SchoolYearImage = ResourceManager.Instance.Load("gakunen_3"); datas[3].SchoolYearImage = ResourceManager.Instance.Load("gakunen_1"); //datas[4].SchoolYearImage = ResourceManager.Instance.Load(""); datas[5].SchoolYearImage = ResourceManager.Instance.Load("gakunen_3"); return(datas); }
public RegionDialog AddRegionList(MasterDataRegion[] regionArray, int selectIndex, Action <RegionContext> action, Action <RegionDialog> loadWaitAction) { if (regionArray == null) { return(this); } RegionList.Clear(); // インジケーターを表示 if (LoadingManager.Instance != null) { LoadingManager.Instance.RequestLoadingStart(LOADING_TYPE.ASSETBUNDLE); } AssetBundlerMultiplier multiplier = AssetBundlerMultiplier.Create(); for (int i = 0; i < regionArray.Length; i++) { MasterDataRegion regionMaster = regionArray[i]; RegionContext newData = new RegionContext(); newData.master = regionMaster; newData.Title = regionMaster.name; newData.IsSelect = (i == selectIndex); newData.IconImage = null; newData.DidSelectItem = OnSelectItem; // アセットバンドルの読み込み uint[] area_cate_ids = MainMenuUtil.CreateRegionMasterContainedAreaCategoryIDs(regionMaster); if (area_cate_ids.Length == 0) { // 開催期間が切れたなどで、有効なクエストが存在しない continue; } uint area_cate_id = area_cate_ids[area_cate_ids.Length - 1]; if (area_cate_id != 0) { string assetBundleName = string.Format("areamapicon_{0}", area_cate_id); multiplier.Add(AssetBundler.Create(). Set(assetBundleName, (o) => { newData.IconImage = o.GetAsset <Sprite>(); newData.IconImage_mask = o.GetTexture(newData.IconImage.name + "_mask", TextureWrapMode.Clamp); }, (s) => { newData.IconImage = ResourceManager.Instance.Load("maeishoku_icon"); }).Load()); } else { newData.IconImage = ResourceManager.Instance.Load("maeishoku_icon"); } RegionList.Add(newData); } multiplier.Load(() => { // インジケーターを閉じる if (LoadingManager.Instance != null) { LoadingManager.Instance.RequestLoadingFinish(LOADING_TYPE.ASSETBUNDLE); } if (loadWaitAction != null) { loadWaitAction(this); } }, () => { // インジケーターを閉じる if (LoadingManager.Instance != null) { LoadingManager.Instance.RequestLoadingFinish(LOADING_TYPE.ASSETBUNDLE); } if (loadWaitAction != null) { loadWaitAction(this); } }); m_SelectIndex = selectIndex; DidSelectItem = action; return(this); }
public void Show(uint areaCategoryFixId, System.Action callback, System.Action finishLoadAction) { Action action = () => { if (finishLoadAction != null) { finishLoadAction(); } PlayAnimation(AppearAnimationName, () => { PlayAnimation(DefaultAnimationName); if (callback != null) { callback(); } }); }; Action itemAction = () => { // Cellの背景取得 // M4Uで接続されるまで時間がかかるので専用処理 AssetBundlerMultiplier multiplier2 = AssetBundlerMultiplier.Create(); if (viewMask2 != null) { GameObject gobj = viewMask2.transform.Find("Content").gameObject; QuestDataListItem[] items = gobj.GetComponentsInChildren <QuestDataListItem>(); for (int i = 0; i < items.Length; i++) { multiplier2.Add(items[i].CreateBg()); } multiplier2.Load(() => { if (action != null) { action(); } }, () => { if (action != null) { action(); } }); } else { if (action != null) { action(); } } }; AssetBundlerMultiplier multiplier = AssetBundlerMultiplier.Create(); multiplier.Add(assetAutoSetEpisodeBackgroundTexture.Create(areaCategoryFixId)); if (m_bEpisodeFirst == false) { for (int i = 0; i < EpisodeList.Count; i++) { EpisodeDataContext context = EpisodeList[i]; multiplier.Add(context.CreatetIcon()); } m_bEpisodeFirst = true; } multiplier.Load(() => { if (itemAction != null) { itemAction(); } }, () => { if (itemAction != null) { itemAction(); } }); }
void LoadHeroData() { m_HeroSelectList = new List <HeroSelectListContext>(); MasterDataHero[] masters = MasterFinder <MasterDataHero> .Instance.SelectWhere("ORDER BY fix_id").ToArray(); m_TutorialHeroSelect.m_HeroImage = new Sprite[masters.Length]; m_TutorialHeroSelect.m_HeroImage_mask = new Texture[masters.Length]; // アセットバンドルの読み込み AssetBundlerMultiplier multiplier = AssetBundlerMultiplier.Create(); for (int i = 0; i < masters.Length; i++) { MasterDataHero heromaster = masters[i]; string hero_name = String.Format("hero_{0:D4}", heromaster.fix_id); string hero_perfom_name = String.Format("tex_hero_perform_l_{0:D4}", heromaster.fix_id); string hero_mask_name = String.Format("tex_hero_perform_l_{0:D4}_mask", heromaster.fix_id); int index = i; multiplier.Add(AssetBundler.Create().Set(hero_name, hero_perfom_name, (o) => { Sprite[] sprites = o.AssetBundle.LoadAssetWithSubAssets <Sprite>(hero_name); Sprite[] herosprites = o.AssetBundle.LoadAssetWithSubAssets <Sprite>(hero_perfom_name); Texture maskTextue = o.GetTexture(hero_mask_name, TextureWrapMode.Clamp); m_TutorialHeroSelect.m_HeroImage[index] = herosprites[0]; m_TutorialHeroSelect.m_HeroImage_mask[index] = maskTextue; switch (index) { case 0: m_TutorialHeroSelect.Tutorial_hero01 = sprites[4]; break; case 1: m_TutorialHeroSelect.Tutorial_hero02 = sprites[4]; break; case 2: m_TutorialHeroSelect.Tutorial_hero03 = sprites[4]; break; case 3: m_TutorialHeroSelect.Tutorial_hero04 = sprites[4]; break; case 4: m_TutorialHeroSelect.Tutorial_hero05 = sprites[4]; break; case 5: m_TutorialHeroSelect.Tutorial_hero06 = sprites[4]; break; } HeroSelectListContext heroSelect = new HeroSelectListContext(); heroSelect.CreatePartyParam(heromaster.default_party_id, this); heroSelect.CreateSkillList(heromaster); heroSelect.Tutorial_text = GameTextUtil.GetText("tutorial_selecttext13"); heroSelect.Profile_text = heromaster.detail; m_HeroSelectList.Add(heroSelect); })); } multiplier.Load(() => { StartCoroutine(LoadHeroDataWait()); }, () => { StartCoroutine(LoadHeroDataWait()); }); }