private void onAbilityStartTarget(StartAbilityTargetModel model) { if (model.targetingPiece != null && model.targetingPiece.gameObject != null) { view.worldPoint(model.targetingPiece.gameObject.transform); } else { view.disable(); } }
private void onStartAbilityTarget(StartAbilityTargetModel model) { abilityTarget = model; }
private void onAbilitySelectTarget(StartAbilityTargetModel card, PieceModel piece) { view.disable(); }
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 }); } }
private void onTargetCancel(PieceModel card) { startTargetModel = null; }
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; }
private void onTargetAbilitySelected(StartAbilityTargetModel c, PieceModel m) { disableTargetCandidate(); }
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; } }