예제 #1
0
        private void OnUnitPositionChangeEnd(Unit unit)
        {
            // It is possible that movement ended the turn already
            if (unit.Team != LocalTeam || TurnManager.CurrentTurnOwner != unit)
            {
                return;
            }

            CrossPlayerController.PerformSkill(unit, unit.Cell, SkillType.Guard);
        }
        // --- Callbacks

        private void OnHexClicked(HexCell hex)
        {
            if (SelectedSkill == SkillType.None || UnitSelectionManager.SelectedUnit == null)
            {
                return;
            }

            // Skill range ?
            // Unit correctness with skill ?

            CrossPlayerController.PerformSkill(UnitSelectionManager.SelectedUnit, hex.Position, SelectedSkill);

            SkillPerformed?.Invoke(SelectedSkill, hex);
        }
예제 #3
0
        private void OnSelectableClicked(Selectable obj)
        {
            if (!UnitSelectionManager.CanSelectedUnitPerformActions)
            {
                return;
            }

            if (obj is Unit unit && AttackRadius.Contains(obj.Cell))
            {
                CrossPlayerController.PerformSkill(UnitSelectionManager.SelectedUnit, unit.Cell, SkillType.Attack);

                SelectionManager.DoNotAllowOtherSystemsToChangeSelection = true;
                SelectionManager.HexSelectionAborted        += OnHexSelectionAborted;
                SelectionManager.SelectableSelectionAborted += OnSelectableSelectionAborted;
            }
        }