public void UpdateInputMode(UnitPlayer _Player, ControllerPlayer _Controller) { if (Input.touchCount >= 1) { Touch touch = Input.touches[0]; if (!m_HasStartedSlash) { m_HasStartedSlash = true; m_SlashStartPosition = touch.position; } UserInterface.DisplaySlashLine(m_SlashStartPosition, touch.position); if (touch.phase == TouchPhase.Canceled) { m_HasStartedSlash = false; UserInterface.HideSlashLine(); } else if (touch.phase == TouchPhase.Ended) { m_HasStartedSlash = false; if (UserInterface.IsMeleeSlashHitting(m_SlashStartPosition, touch.position)) { _Player.AttackEnemy(); } UserInterface.HideSlashLine(); } } }
public void OnPlayerAttacked(UnitEnemy _Enemy) { if (_Enemy != null) { m_Player.TakeDamages(1); m_Player.AttackEnemy(); } /* * if (Application.isMobilePlatform) * { * if (_Enemy != null) * { * SetInputMode(new InputMode_MeleeBattle()); * } * else * { * SetInputMode(new InputMode_Movement()); * } * } * else * { * if (_Enemy != null) * { * SetInputMode(new InputMode_MeleeBattleDebug()); * } * else * { * SetInputMode(new InputMode_MovementDebug()); * } * }*/ }