void LaunchBattle(PawnInstance _aggroTarget) { if (GetComponentInParent <Monster>().BattleOnCollision&& _aggroTarget.GetComponentInParent <Fighter>() != null && _aggroTarget.GetComponentInParent <Fighter>().IsTargetableByMonster == true) { BattleHandler.StartBattleProcess(instance.CurrentTile); GameManager.Instance.UpdateCameraPosition(_aggroTarget); } }
private void Attack(int _i = 0) { if (GameManager.Instance.CurrentState == GameState.Normal) { //NavMeshAgent agent = GameManager.Instance.GetFirstSelectedKeeper().GetComponent<NavMeshAgent>(); //if (agent != null && agent.isActiveAndEnabled) // agent.SetDestination(transform.position); if (GetComponentInParent <Fighter>() != null && GetComponentInParent <Fighter>().IsTargetableByMonster == true) { if (BattleHandler.IsABattleAlreadyInProcess()) { return; } Tile tile = GetComponentInParent <PawnInstance>().CurrentTile; BattleHandler.StartBattleProcess(tile); GameManager.Instance.UpdateCameraPosition(GetComponentInParent <PawnInstance>()); } } }