public void InitEnemy(UITexture ui_tex, uint enemy_id, string foundation_name, OutGameSettingsManager.EnemyDisplayInfo.SCENE target_scene, Action <bool, EnemyLoader> callback = null, ENEMY_MOVE_TYPE moveType = ENEMY_MOVE_TYPE.DEFULT, bool is_Howl = true) { EnemyTable.EnemyData enemyData = Singleton <EnemyTable> .I.GetEnemyData(enemy_id); if (enemyData == null) { Clear(); if (callback != null) { callback(false, null); } } else { Init(ui_tex, 45f, LOADER_TYPE.ENEMY); enemyID = (int)enemy_id; foundationName = foundation_name; targetScene = target_scene; isEnemyHowl = is_Howl; int anim_id = enemyData.animId; float scale = enemyData.modelScale; if (targetScene == OutGameSettingsManager.EnemyDisplayInfo.SCENE.QUEST) { enemyDispplayInfo = MonoBehaviourSingleton <OutGameSettingsManager> .I.SearchEnemyDisplayInfoForQuestSelect(enemyData); } else { enemyDispplayInfo = MonoBehaviourSingleton <OutGameSettingsManager> .I.SearchEnemyDisplayInfoForGacha(enemyData); } if (enemyDispplayInfo != null) { if (enemyDispplayInfo.animID > 0) { anim_id = enemyDispplayInfo.animID; } scale = enemyDispplayInfo.scale; } enemyLoader.StartLoad(enemyData.modelId, anim_id, scale, enemyData.baseEffectName, enemyData.baseEffectNode, false, false, true, SHADER_TYPE.UI, modelLayer, foundation_name, false, false, delegate(Enemy enemy) { if (callback != null) { callback(true, enemyLoader); } if (enemyLoader != null && enemyLoader.animator != null) { if (moveType == ENEMY_MOVE_TYPE.DONT_MOVE) { enemyLoader.animator.set_applyRootMotion(false); } else if (moveType == ENEMY_MOVE_TYPE.STOP) { enemyLoader.animator.set_speed(0f); } } OnEnemyLoadFinished(enemy); }); LoadStart(); } }
protected void PlayEnemyAudio(EnemyTable.EnemyData enemyData, bool is_short = false) { if (!skip) { OutGameSettingsManager.EnemyDisplayInfo enemyDisplayInfo = MonoBehaviourSingleton <OutGameSettingsManager> .I.SearchEnemyDisplayInfoForGacha(enemyData); if (enemyDisplayInfo != null) { int num = (!is_short) ? enemyDisplayInfo.seIdGachaLong : enemyDisplayInfo.seIdGachaShort; if (num > 0) { SoundManager.PlayOneshotJingle(num, null, null); } } } }
protected void CacheEnemyAudio(EnemyTable.EnemyData enemyData, LoadingQueue lo_queue) { if (lo_queue != null) { OutGameSettingsManager.EnemyDisplayInfo enemyDisplayInfo = MonoBehaviourSingleton <OutGameSettingsManager> .I.SearchEnemyDisplayInfoForGacha(enemyData); if (enemyDisplayInfo != null) { if (enemyDisplayInfo.seIdGachaShort > 0) { lo_queue.CacheSE(enemyDisplayInfo.seIdGachaShort, null); } if (enemyDisplayInfo.seIdGachaLong > 0) { lo_queue.CacheSE(enemyDisplayInfo.seIdGachaLong, null); } } } }
private IEnumerator DoQuestGacha() { Init(); int display_rarity = 0; SetLinkCamera(true); int enemy_id = 0; EnemyTable.EnemyData enemy_data = null; if (MonoBehaviourSingleton <GachaManager> .I.gachaResult != null) { GachaResult.GachaReward reward = MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward[0]; uint reward_quest_id = (uint)reward.itemId; QuestTable.QuestTableData quest_data = Singleton <QuestTable> .I.GetQuestData(reward_quest_id); if (quest_data != null) { enemy_data = Singleton <EnemyTable> .I.GetEnemyData((uint)quest_data.GetMainEnemyID()); } } if (enemy_data == null) { if (enemy_id == 0) { enemy_id = 1101001; } enemy_data = Singleton <EnemyTable> .I.GetEnemyData((uint)enemy_id); } NPCLoader npc_loader = LoadNPC(); EnemyLoader enemy_loader = null; if (enemy_data != null) { int displayAnimID = enemy_data.animId; OutGameSettingsManager.EnemyDisplayInfo displayInfo = MonoBehaviourSingleton <OutGameSettingsManager> .I.SearchEnemyDisplayInfoForGacha(enemy_data); int modelID = enemy_data.modelId; float displayScale = enemy_data.modelScale; if (displayInfo != null) { displayAnimID = displayInfo.animID; displayScale = displayInfo.gachaScale; } enemy_loader = LoadEnemy(enemyPosition, modelID, displayAnimID, displayScale, enemy_data.baseEffectName, enemy_data.baseEffectNode); while (enemy_loader.isLoading) { yield return((object)null); } enemy_loader.ApplyGachaDisplayScaleToParentNode(); CheckAndReplaceShader(enemy_loader); enemy_loader.get_gameObject().SetActive(false); } while (npc_loader.isLoading) { yield return((object)null); } LoadingQueue lo_queue = new LoadingQueue(this); CacheAudio(lo_queue); if (enemy_data != null) { CacheEnemyAudio(enemy_data, lo_queue); } while (lo_queue.IsLoading()) { yield return((object)null); } PlayerAnimCtrl npc_anim = PlayerAnimCtrl.Get(npc_loader.animator, PLCA.IDLE_01, null, null, null); CreateNPCEffect(npc_loader.model); yield return((object)null); stageAnimator.set_cullingMode(0); stageAnimator.Rebind(); targetRarity = MonoBehaviourSingleton <GachaManager> .I.GetMaxRarity().ToRarityExpressionID() + 1; if (targetRarity > 4) { targetRarity = 4; } stageAnimator.Play("StageAnim_Main"); Play("MainAnim_Start", null, 0f); PlayEffect(startEffectPrefabs[0]); npc_anim.Play(PLCA.QUEST_GACHA, true); bool rankup3 = UpdateDisplayRarity(ref display_rarity); PlayAudio(AUDIO.OPENING_01); while (Step(0.5f)) { yield return((object)null); } PlayAudio(AUDIO.OPENING_02); PlayAudio(AUDIO.OPENING_03); while (Step(1.4f)) { yield return((object)null); } PlayAudio(AUDIO.OPENING_04); while (Step(2.6f)) { yield return((object)null); } PlayAudio(AUDIO.DOOR_01); while (Step(3.2f)) { yield return((object)null); } PlayAudio(AUDIO.DOOR_02); while (Step(3.38f)) { yield return((object)null); } PlayAudio(AUDIO.MAGI_INTRO_01); while (Step(6.5f)) { yield return((object)null); } npc_loader.get_gameObject().SetActive(false); PlayMeteorEffect(display_rarity); PlayAudio(AUDIO.METEOR_01); while (Step(7.5f)) { yield return((object)null); } PlayMagicEffect(display_rarity, rankup3); PlayMagicAudio(display_rarity); rankup3 = UpdateDisplayRarity(ref display_rarity); PlayMeteorEffect(display_rarity); while (Step(8.5f)) { yield return((object)null); } PlayMagicEffect(display_rarity, rankup3); PlayMagicAudio(display_rarity); rankup3 = UpdateDisplayRarity(ref display_rarity); PlayMeteorEffect(display_rarity); PlayAudio(AUDIO.METEOR_02); while (Step(9.5f)) { yield return((object)null); } PlayMagicEffect(display_rarity, rankup3); PlayMagicAudio(display_rarity); while (Step(10.5f)) { yield return((object)null); } if (enemy_loader != null) { enemy_loader.get_gameObject().SetActive(true); } if (!skip) { PlayEnemyAnimation(enemy_loader, "Base Layer.GACHA_SINGLE"); } Play("MainAnim_End", null, 0f); UpdateDisplayRarity(ref display_rarity); PlayEndEffect(display_rarity); RARITY_TYPE rarity = MonoBehaviourSingleton <GachaManager> .I.GetMaxRarity(); PlayAppearAudio(rarity, false); if (enemy_data != null) { PlayEnemyAudio(enemy_data, false); } while (Step(11.5f)) { yield return((object)null); } while (Step(13f)) { yield return((object)null); } if (skip) { while (MonoBehaviourSingleton <TransitionManager> .I.isChanging) { yield return((object)null); } PlayEnemyAnimation(enemy_loader, "Base Layer.IDLE"); Time.set_timeScale(1f); if (MonoBehaviourSingleton <TransitionManager> .I.isTransing) { yield return((object)MonoBehaviourSingleton <TransitionManager> .I.In()); } } else { skip = true; } Time.set_timeScale(1f); sectionCommandReceiver.OnEnd(); }
private IEnumerator DoQuestGacha() { m_isSkipAll = false; Init(); SetLinkCamera(true); EnemyLoader[] enemyLoaderList = new EnemyLoader[11]; EnemyTable.EnemyData[] enemy_datas = new EnemyTable.EnemyData[11]; QuestTable.QuestTableData[] quest_datas = new QuestTable.QuestTableData[11]; if (MonoBehaviourSingleton <GachaManager> .IsValid() && MonoBehaviourSingleton <GachaManager> .I.gachaResult != null) { int i = 0; for (int n2 = MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward.Count; i < n2; i++) { GachaResult.GachaReward reward = MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward[i]; uint reward_quest_id = (uint)reward.itemId; quest_datas[i] = Singleton <QuestTable> .I.GetQuestData(reward_quest_id); if (quest_datas[i] != null) { enemy_datas[i] = Singleton <EnemyTable> .I.GetEnemyData((uint)quest_datas[i].GetMainEnemyID()); if (enemy_datas[i] == null) { Log.Error("EnemyTable[{0}] == null", quest_datas[i].GetMainEnemyID()); } } else { Log.Error("QuestTable[{0}] == null", reward.itemId); quest_datas[i] = new QuestTable.QuestTableData(); enemy_datas[i] = new EnemyTable.EnemyData(); } } } NPCLoader npc_loader = LoadNPC(); npc_loader.Load(Singleton <NPCTable> .I.GetNPCData(2).npcModelID, 0, false, true, SHADER_TYPE.NORMAL, null); int n = 0; for (int m = 11; n < m; n++) { float scale = enemy_datas[n].modelScale; int displayAnimID = enemy_datas[n].animId; int modelID = enemy_datas[n].modelId; OutGameSettingsManager.EnemyDisplayInfo displayInfo = MonoBehaviourSingleton <OutGameSettingsManager> .I.SearchEnemyDisplayInfoForGacha(enemy_datas[n]); if (displayInfo != null) { displayAnimID = displayInfo.animID; scale = displayInfo.gachaScale; } enemyLoaderList[n] = LoadEnemy(enemyPositions[n], modelID, displayAnimID, scale, enemy_datas[n].baseEffectName, enemy_datas[n].baseEffectNode); } int l = 0; for (int k = 11; l < k; l++) { while (enemyLoaderList[l].isLoading) { yield return((object)null); } enemyLoaderList[l].ApplyGachaDisplayScaleToParentNode(); CheckAndReplaceShader(enemyLoaderList[l]); enemyLoaderList[l].get_gameObject().SetActive(false); } LoadingQueue lo_queue = new LoadingQueue(this); CacheAudio(lo_queue); for (int j = 0; j < 11; j++) { CacheEnemyAudio(enemy_datas[j], lo_queue); } while (npc_loader.isLoading) { yield return((object)null); } while (lo_queue.IsLoading()) { yield return((object)null); } PlayerAnimCtrl npc_anim = PlayerAnimCtrl.Get(npc_loader.animator, PLCA.IDLE_01, null, null, null); CreateNPCEffect(npc_loader.model); yield return((object)null); stageAnimator.set_cullingMode(0); stageAnimator.Rebind(); stageAnimator.Play("StageAnim_Main"); Play("MainAnim_Start", null, 0f); PlayEffect(startEffectPrefabs[0]); npc_anim.Play(PLCA.QUEST_GACHA, true); PlayAudio(AUDIO.OPENING_01); while (Step(0.5f)) { yield return((object)null); } PlayAudio(AUDIO.OPENING_02); PlayAudio(AUDIO.OPENING_03); while (Step(1.4f)) { yield return((object)null); } PlayAudio(AUDIO.OPENING_04); while (Step(2.6f)) { yield return((object)null); } PlayAudio(AUDIO.DOOR_01); while (Step(3.2f)) { yield return((object)null); } PlayAudio(AUDIO.DOOR_02); while (Step(3.38f)) { yield return((object)null); } PlayAudio(AUDIO.MAGI_INTRO_01); while (Step(5.1f)) { yield return((object)null); } PlayAudio(AUDIO.MAGI_INTRO_02); while (Step(5.5f)) { yield return((object)null); } PlayEffect(startEffectPrefabs[1]); Transform[] magic_effects = (Transform[])new Transform[11]; Transform[] end_effects = (Transform[])new Transform[11]; int meteor_step = 0; int magic_step = 0; int max_step = 11; time -= Time.get_deltaTime(); while (meteor_step < max_step || magic_step < max_step) { time += Time.get_deltaTime(); if (meteor_step < max_step && meteorTimings[meteor_step] <= time) { PlayEffect(magicCircles[meteor_step], meteorEffectPrefabs[quest_datas[meteor_step].rarity.ToRarityExpressionID()]); if (meteor_step == max_step - 1) { PlayAudio(AUDIO.METEOR_01); } meteor_step++; } if (magic_step < max_step && magicTimings[magic_step] <= time) { magic_effects[magic_step] = PlayEffect(magicCircles[magic_step], magicEffectPrefabs[quest_datas[magic_step].rarity.ToRarityExpressionID()]); PlayMagicAudio((int)quest_datas[magic_step].rarity); magic_step++; } yield return((object)null); } int idx = magic_step - 1; if (idx < max_step && idx >= 0) { PlayMagicAudio((int)quest_datas[idx].rarity); } while (Step(13.5f)) { yield return((object)null); } if (skip && !m_isSkipAll) { if (MonoBehaviourSingleton <TransitionManager> .I.isChanging) { yield return((object)null); } Time.set_timeScale(1f); skip = false; time = 13.5f; yield return((object)MonoBehaviourSingleton <TransitionManager> .I.In()); sectionCommandReceiver.ActivateSkipButton(); } ActivateFirstSkipFlag(); int end_step = 0; float end_time2 = 13.5f; float end_step_time = 1.5f; float end_step_time_last = 2f; RARITY_TYPE rarity_type; while (true) { sectionCommandReceiver.OnHideRarity(); PlayAudio(AUDIO.RARITY_EXPOSITION); if (end_step > 0) { int prevIndex = end_step - 1; if (enemyLoaderList[prevIndex] != null) { enemyLoaderList[prevIndex].get_gameObject().SetActive(false); } if (magic_effects[prevIndex] != null) { Object.Destroy(magic_effects[prevIndex].get_gameObject()); magic_effects[prevIndex] = null; } if (end_effects[prevIndex] != null) { Object.Destroy(end_effects[prevIndex].get_gameObject()); end_effects[prevIndex] = null; } } EnemyLoader nowEnemyLoader = enemyLoaderList[end_step]; nowEnemyLoader.get_gameObject().SetActive(true); if (!skip) { string stateName = "Base Layer.GACHA_11"; if (end_step == enemyLoaderList.Length - 1) { stateName = "Base Layer.GACHA_SINGLE"; } PlayEnemyAnimation(nowEnemyLoader, stateName); } rarity_type = quest_datas[end_step].rarity; int effect_rarity = rarity_type.ToRarityExpressionID(); if (rarity_type == RARITY_TYPE.SS) { effect_rarity = 3; } end_effects[end_step] = PlayEffect(magicCircles[end_step], endEffectPrefabs[effect_rarity]); Play($"MainAnim_End_{end_step + 1:D2}", null, 0f); bool is_short = end_step < 11; PlayAppearAudio(rarity_type, is_short); if (enemy_datas.Length > end_step) { PlayEnemyAudio(enemy_datas[end_step], is_short); } end_step++; if (end_step >= 11) { break; } float waitTime = 0f; while (waitTime < showRarityWaitTime) { waitTime += Time.get_deltaTime(); if (base.IsSkipAppearEnemy) { waitTime = showRarityWaitTime; } yield return((object)null); } if (!base.IsSkipAppearEnemy) { sectionCommandReceiver.OnShowRarity(rarity_type); } end_time2 += end_step_time; while (Step(end_time2)) { if (base.IsSkipAppearEnemy) { time = end_time2; } yield return((object)null); } sectionCommandReceiver.ActivateSkipButton(); ResetSkipAppearEnemyFlag(); } yield return((object)new WaitForSeconds(lastShowRarityWaitTime)); sectionCommandReceiver.OnShowRarity(rarity_type); end_time2 += end_step_time_last; while (Step(end_time2)) { yield return((object)null); } if (skip) { while (MonoBehaviourSingleton <TransitionManager> .I.isChanging) { yield return((object)null); } int lastIndex = enemyLoaderList.Length - 1; if (lastIndex >= 0) { PlayEnemyAnimation(enemyLoaderList[lastIndex], "Base Layer.IDLE"); } Time.set_timeScale(1f); if (MonoBehaviourSingleton <TransitionManager> .I.isTransing) { yield return((object)MonoBehaviourSingleton <TransitionManager> .I.In()); } } else { skip = true; } sectionCommandReceiver.OnHideRarity(); Time.set_timeScale(1f); sectionCommandReceiver.OnEnd(); }