Beispiel #1
0
    public void Bowl(int pinFall)
    {
        ball.Reset();
        // Prevent pins fall adding to List rolls if Endgame.
        if (ActionMaster.NextAction(rolls) == ActionMaster.Action.EndGame)
        {
            Debug.LogWarning("Game ends, please reset.");
            return;
        }
        try{
            rolls.Add(pinFall);
            // Will run through all the list,but will only return the last action.
            pinSetter.SwiperAction(ActionMaster.NextAction(rolls));
        }catch {
            Debug.LogWarning("Error occurs at Bowl()");
        }
        if (ActionMaster.NextAction(rolls) == ActionMaster.Action.EndGame)
        {
            cheatButton.SetActive(true);
            gameOver.SetActive(true);
            Debug.LogWarning("Game ends, please reset.");
        }

        //print ("pinFall is " + pinFall + ", lastSettleCount is " + pinCounter.CountStanding () + ", " + ActionMaster.NextAction (bowls));
//		try{
        scoreDisplay.FillRolls(rolls);
        scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));

        //scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));
//		}catch{
//			Debug.LogWarning ("Error occurs at FillRollCard()");
//		}
    }