예제 #1
0
 private void onAbilityStartTarget(StartAbilityTargetModel model)
 {
     if (model.targetingPiece != null && model.targetingPiece.gameObject != null)
     {
         view.worldPoint(model.targetingPiece.gameObject.transform);
     }
     else
     {
         view.disable();
     }
 }
예제 #2
0
 private void onStartAbilityTarget(StartAbilityTargetModel model)
 {
     abilityTarget = model;
 }
예제 #3
0
 private void onAbilitySelectTarget(StartAbilityTargetModel card, PieceModel piece)
 {
     view.disable();
 }
예제 #4
0
        private void onAbilityClicked()
        {
            var piece = view.piece;
            var targets = possibleActions.GetAbilitiesForPiece(piece.playerId, piece.id);
            if (targets != null && targets.targetPieceIds.Count >= 1)
            {
                //record state we need to maintain for subsequent clicks then dispatch the start target
                startTargetModel = new StartAbilityTargetModel()
                {
                    targetingPiece = piece,
                    targets = targets
                };

                //delay sending off the start select target signal till the card deselected event has cleared
                Invoke("StartSelectTargets", 0.10f);
            }
            else
            {
                activateAbility.Dispatch(new ActivateAbilityModel()
                {
                    piece = piece,
                    optionalTarget = null
                });
            }
        }
예제 #5
0
 private void onTargetCancel(PieceModel card)
 {
     startTargetModel = null;
 }
예제 #6
0
        private void onSelectedTarget(StartAbilityTargetModel targetModel, PieceModel piece)
        {
            if(targetModel.targetingPiece.id != view.ability.pieceId) return;

            activateAbility.Dispatch(new ActivateAbilityModel()
            {
                piece = targetModel.targetingPiece,
                optionalTarget = piece
            });
            startTargetModel = null;
        }
예제 #7
0
 private void onTargetAbilitySelected(StartAbilityTargetModel c, PieceModel m)
 {
     disableTargetCandidate();
 }
예제 #8
0
 private void onStartSelectAbilityTarget(StartAbilityTargetModel model)
 {
     var selected = pieces.Pieces.Where(p => model.targets.targetPieceIds.Contains(p.id));
     foreach (var piece in selected)
     {
         piece.pieceView.targetCandidate = true;
     }
 }