//攻撃処理 public void Attack(MapPresenter m, Dictionary <int, CharacterPresenter> characterListPresenter) { Vector3 pos = status.position + status.direction; if (pos.x < 0 || pos.z < 0) { return; } var vector2Int = new Vector2Int((int)pos.x, (int)pos.z); if (m.GetTileModel(vector2Int).charaType == TileModel.CharaType.Player || m.GetTileModel(vector2Int).charaType == TileModel.CharaType.Enemy) { CharacterPresenter characterPresenter = characterListPresenter .FirstOrDefault(presenter => presenter.Key == m.GetTileModel(vector2Int).guid).Value; int damage = CalcAction.CalcAttack(status, characterPresenter.status); Debug.Log("Attack Damage : " + damage); characterPresenter.CalcHp(damage); Debug.Log("After Hp : " + characterPresenter.status.hp); ActionLogPresenter.Instance.ShowView(); ActionLogPresenter.Instance.AddLog(LogType.Attack, new string[] { status.name, characterPresenter.status.name, damage.ToString() }); if (characterPresenter.status.hp <= 0) { characterPresenter.Death(); } } SetIsAction(true); characterView.Attack(); }