public void Initialize() { DataCharaParam data_chara = DataManager.Instance.dataChara.list.Find(p => p.status == DataChara.STATUS.USING.ToString()); MasterCharaParam master_chara = DataManager.Instance.masterChara.list.Find(p => p.chara_id == data_chara.chara_id); m_imgChara.sprite = m_spriteAtlas.GetSprite(master_chara.GetIconName()); int position = 1; foreach (IconSkill icon in m_iconSkillList) { DataSkillParam data = DataManager.Instance.dataSkill.list.Find(p => p.position == position); if (data == null) { data = new DataSkillParam(0, position); } MasterSkillParam master = DataManager.Instance.masterSkill.list.Find(p => p.skill_id == data.skill_id); icon.Initialize(data, master); position += 1; } DataPotionParam data_potion = DataManager.Instance.dataPotion.list.Find(p => p.is_use == true); MasterPotionParam master_potion = DataManager.Instance.masterPotion.list.Find(p => p.potion_id == data_potion.potion_id); //Debug.Log(data_potion.potion_id); //Debug.Log(master_potion.potion_id); m_iconPotion.Initialize(data_potion, master_potion); }
private void use_potion() { DataPotionParam data_potion = DataManager.Instance.dataPotion.list.Find(p => p.is_use == true); MasterPotionParam master_potion = DataManager.Instance.masterPotion.list.Find(p => p.potion_id == data_potion.potion_id); if (0 < data_potion.num) { data_potion.num -= 1; gamemain.player_chara.Heal(master_potion.heal); gamemain.icon_potion.UseUpdate(); } }
public override void OnEnter() { base.OnEnter(); DataPotionParam data_potion = DataManager.Instance.dataPotion.list.Find(p => p.is_use == true); MasterPotionParam master_potion = DataManager.Instance.masterPotion.list.Find(p => p.potion_id == data_potion.potion_id); if (DataManager.Instance.UseCoin(master_potion.add_coin)) { data_potion.num += 1; } DataManager.Instance.dataPotion.Save(); DataManager.Instance.user_data.Save(); Finish(); }
public void Initialize(int _iCoin) { DataPotionParam data_potion = DataManager.Instance.dataPotion.list.Find(p => p.is_use == true); MasterPotionParam master_potion = DataManager.Instance.masterPotion.list.Find(p => p.potion_id == data_potion.potion_id); m_iconPotion.Initialize(data_potion, master_potion); if (0 < master_potion.next_potion_id) { m_txtUpgradePrice.text = master_potion.upgrade_coin.ToString(); } else { m_txtUpgradePrice.text = "-----"; } m_txtAddPrice.text = master_potion.add_coin.ToString(); m_btnUpgrade.interactable = (master_potion.upgrade_coin <= _iCoin); m_btnAdd.interactable = (master_potion.add_coin <= _iCoin && data_potion.num < Defines.POTION_LIMIT); if (master_potion.next_potion_id == 0) { m_txtLabelUpgrade.text = "ポーション\nアップグレード\n<color=red>強化上限です</color"; } else if (_iCoin < master_potion.upgrade_coin) { m_txtLabelUpgrade.text = "ポーション\nアップグレード\nコイン不足"; } else { m_txtLabelUpgrade.text = "ポーション\nアップグレード"; } if (Defines.POTION_LIMIT <= data_potion.num) { m_txtLabelAdd.text = "追加購入\n<color=red>所持数の上限</color>"; } else if (_iCoin < master_potion.add_coin) { m_txtLabelAdd.text = "追加購入\n<color=red>コインが足りません</color>"; } else { m_txtLabelAdd.text = "追加購入"; } }
public void Initialize(DataPotionParam _data, MasterPotionParam _master) { m_dataPotion = _data; m_masterPotion = _master; m_btn.onClick.RemoveAllListeners(); if (m_masterPotion == null) { Debug.Log(m_dataPotion.potion_id); } m_txtName.text = m_masterPotion.name; m_imgPotion.sprite = m_spriteAtlas.GetSprite(m_masterPotion.sprite_name); m_txtNum.text = string.Format("x{0}", _data.num); m_txtCoolTime.text = string.Format("{0:0.00}秒", m_masterPotion.cool_time); }
public override void OnEnter() { base.OnEnter(); float fAutoPotionRate = DataManager.Instance.user_data.ReadFloat(Defines.KEY_AUTOPOTION_RATE); gamemain.m_btnAuto.Initialize(DataManager.Instance.user_data.ReadInt(Defines.KEY_USE_AUTOMOVE) != 0); gamemain.m_btnAutoPotion.Initialize( DataManager.Instance.user_data.ReadInt(Defines.KEY_USE_AUTOPOTION) != 0, fAutoPotionRate); gamemain.player_chara.gameObject.SetActive(true); gamemain.m_panelPauseMenu.m_soundvolumeBGM.SetVolume(DataManager.Instance.user_data.ReadFloat(Defines.KEY_SOUNDVOLUME_BGM)); BGMControl.Instance.Play("anime_06_loop"); gamemain.m_panelPauseMenu.m_soundvolumeSE.SetVolume(DataManager.Instance.user_data.ReadFloat(Defines.KEY_SOUNDVOLUME_SE)); //Debug.Log( string.Format("floor_id={0}", DataManager.Instance.game_data.ReadInt("floor_id"))); int floor_id = DataManager.Instance.game_data.ReadInt("floor_id"); gamemain.m_txtFloor.text = string.Format("{0}", floor_id); gamemain.master_floor_param = DataManager.Instance.masterFloor.list.Find(p => p.floor_id == floor_id); gamemain.master_stage_param = DataManager.Instance.masterStage.list.Find(p => p.stage_id == gamemain.master_floor_param.stage_id); gamemain.background.spr_renderer.sprite = gamemain.m_spriteAtlasBackground.GetSprite(gamemain.master_stage_param.bg_name); //gamemain.player_chara.Damage(10); DataPotionParam data_potion = DataManager.Instance.dataPotion.list.Find(p => p.is_use == true); MasterPotionParam master_potion = DataManager.Instance.masterPotion.list.Find(p => p.potion_id == data_potion.potion_id); gamemain.icon_potion.InitializeGame(data_potion, master_potion); gamemain.icon_skill_arr = gamemain.m_goIconRoot.GetComponentsInChildren <IconSkill>(); for (int i = 0; i < gamemain.icon_skill_arr.Length; i++) { int position = i + 1; DataSkillParam data = DataManager.Instance.dataSkill.list.Find(p => p.position == position); if (data == null) { data = new DataSkillParam(0, position); } MasterSkillParam master = DataManager.Instance.masterSkill.list.Find(p => p.skill_id == data.skill_id); gamemain.icon_skill_arr[i].InitializeGame(data, master); } #region 敵 gamemain.m_prefEnemy.gameObject.SetActive(false); //gamemain.m_prefEnemyHpBar.gameObject.SetActive(false); foreach (GameObject zako_pos in gamemain.zako_position) { MonoBehaviourEx.DeleteObjects <Transform>(zako_pos); create_enemy( gamemain.master_floor_param.enemy_id, gamemain.master_floor_param.enemy_level, zako_pos, false); } MonoBehaviourEx.DeleteObjects <Transform>(gamemain.boss_position); create_enemy( gamemain.master_floor_param.boss_enemy_id, gamemain.master_floor_param.boss_level, gamemain.boss_position, true); #endregion }
public void InitializeGame(DataPotionParam _data, MasterPotionParam _master) { Initialize(_data, _master); m_animator.speed = 1 / _master.cool_time; m_animator.SetBool("enable", 0 < _data.num); }