private void SetPinCounterMaxPinsForCurrentRollBasedOnNextAction(ActionMaster.Action nextAction, int pinsKnockedDown) { if (nextAction == ActionMaster.Action.Tidy) { pinCounter.SetMaxPinsForCurrentRoll(INITIAL_PIN_COUNT - pinsKnockedDown); } else if (nextAction == ActionMaster.Action.Reset || nextAction == ActionMaster.Action.EndTurn) { pinCounter.SetMaxPinsForCurrentRoll(INITIAL_PIN_COUNT); } else if (nextAction == ActionMaster.Action.EndGame) { throw new UnityException("Don't know how to handle EndGame!"); } }
private void InitializePinCounter() { pinCounter = GameObject.FindObjectOfType<PinCounter>(); pinCounter.SetMaxPinsForCurrentRoll(INITIAL_PIN_COUNT); }