/// <summary> /// パーティメンバー個別へのダメージ演出(ダメージ数値) /// </summary> /// <param name="member_index"></param> /// <param name="effect_prefab"></param> public void setDamageValueMember(MasterDataDefineLabel.ElementType damage_element, BattleSceneUtil.MultiInt damage_value, BattleSceneUtil.MultiInt damage_target) { if (BattleParam.IsKobetsuHP == false) { return; } for (int idx = 0; idx < damage_value.getMemberCount(); idx++) { int dmg_target = damage_target.getValue((GlobalDefine.PartyCharaIndex)idx); if (dmg_target > 0) { int dmg_value = damage_value.getValue((GlobalDefine.PartyCharaIndex)idx); EDAMAGE_TYPE damage_type = EDAMAGE_TYPE.eDAMAGE_TYPE_NORMAL; if (damage_element != MasterDataDefineLabel.ElementType.NONE) { CharaOnce chara_once = BattleParam.m_PlayerParty.getPartyMember((GlobalDefine.PartyCharaIndex)idx, CharaParty.CharaCondition.EXIST); if (chara_once != null) { damage_type = InGameUtilBattle.GetSkillElementAffinity(damage_element, chara_once.m_CharaMasterDataParam.element); } } DrawDamageManager.showDamage(m_MemberHPTrans[idx], dmg_value, damage_type, 3.0f, getInterfaceExtentionRate() * INTERFACE_EXTENTION_DAMAGE_VALUE_OFFSET_Y + 0.14f, 2.0f); } } }
/// <summary> /// 敵にダメージ数値を表示 /// </summary> /// <param name="damage_value"></param> /// <param name="damage_type"></param> public void setDmageDisp(int damage_value, EDAMAGE_TYPE damage_type) { if (m_DamageNumberLocale != null) { DrawDamageManager.showDamage(m_DamageNumberLocale.transform, damage_value, damage_type); } }
public static void showDamage(Transform parent, int damage_value, EDAMAGE_TYPE damage_type, float scale = 1.0f, float offset_y = 0.0f, float type_scale = 1.0f) { if (Instance != null) { Instance._showDamage(parent, damage_value, damage_type, scale, offset_y, type_scale); } }
// ダメージ描画 public void damageEnemy(int enemy_index, int damage, EDAMAGE_TYPE damage_type) { m_EnemyObjectViewControls[enemy_index].setDmageDisp(damage, damage_type); if (damage_type != EDAMAGE_TYPE.eDAMAGE_TYPE_HEAL) { playAnimation(enemy_index, AnimationType.DAMAGE); } }
private void _showDamage(Transform parent, int damage_value, EDAMAGE_TYPE damage_type, float scale, float offset_y, float type_scale) { DamageViewInfo damage_view_info = m_DamageViewInfots[m_CurrentIndex]; if (damage_view_info.m_InstanceObject == null) { // 表示中にライド先の削除に巻き込まれて消える場合があるので.その場合インスタンスを作り直し. setupDamageViewInfo(damage_view_info); } damage_view_info.m_ShowTimer = 1.0f; damage_view_info.m_InstanceObject.transform.SetParent(parent, false); if (damage_view_info.m_TextMesh != null) { string anim_name = null; Sprite weak_sprite = null; Color moji_color = MOJI_COLORS[(int)damage_type]; Color moji_shadow_color = MOJI_SHADOW_COLORS[(int)damage_type]; float moji_scale = MOJI_SCALES[(int)damage_type]; switch (damage_type) { case EDAMAGE_TYPE.eDAMAGE_TYPE_NORMAL: default: { anim_name = TEXT_ANIM_NAME_DAMAGE; weak_sprite = null; } break; case EDAMAGE_TYPE.eDAMAGE_TYPE_WEEK: { anim_name = TEXT_ANIM_NAME_DAMAGE; weak_sprite = m_WeakSprite; } break; case EDAMAGE_TYPE.eDAMAGE_TYPE_GUARD: { anim_name = TEXT_ANIM_NAME_DAMAGE_GUARD; weak_sprite = m_GuardSprite; } break; case EDAMAGE_TYPE.eDAMAGE_TYPE_HEAL: { anim_name = TEXT_ANIM_NAME_DAMAGE_GUARD; weak_sprite = null; } break; case EDAMAGE_TYPE.eDAMAGE_TYPE_CRITICAL: { anim_name = TEXT_ANIM_NAME_DAMAGE; weak_sprite = m_CriticalSprite; } break; } damage_view_info.m_InstanceObject.transform.localPosition = new Vector3(0.0f, offset_y, 0.0f); damage_view_info.m_TextMesh.text = damage_value.ToString(); damage_view_info.m_TextMesh.color = moji_color; if (damage_view_info.m_TextMesh != null) { damage_view_info.m_TextMesh.fontMaterial.SetColor("_UnderlayColor", moji_shadow_color); } damage_view_info.m_TextMesh.gameObject.GetComponent <RectTransform>().localScale = Vector3.one * (moji_scale * 0.05f * scale); const float WEAK_SPRITE_BASE_SCALE = 0.5f; damage_view_info.m_WeakSprite.transform.localScale = new Vector3(type_scale * WEAK_SPRITE_BASE_SCALE, type_scale * WEAK_SPRITE_BASE_SCALE, type_scale * WEAK_SPRITE_BASE_SCALE); damage_view_info.m_WeakSprite.sprite = weak_sprite; damage_view_info.m_InstanceObject.SetActive(true); damage_view_info.m_TextAnimation.Stop(); damage_view_info.m_TextAnimation.Play(anim_name); if (weak_sprite != null) { damage_view_info.m_SpriteAnimation.Stop(); if (weak_sprite == m_CriticalSprite) { damage_view_info.m_SpriteAnimation.Play(SPRITE_ANIM_NAME_CRITICAL); } else { damage_view_info.m_SpriteAnimation.Play(SPRITE_ANIM_NAME); } } } m_CurrentIndex = (m_CurrentIndex + 1) % m_DamageViewInfots.Length; m_IsShowing = true; }