예제 #1
0
    void Update()
    {
        if (scoreDisplay == null)
        {
            GameObject canvas = GameObject.Find("ScoreCanvas");
            scoreDisplay = canvas.GetComponent <ScoreDisplay>();
        }
        else
        {
            for (int i = 0; i < names.Count; i++)
            {
                ScoreDisplay.Score score = new ScoreDisplay.Score(names[i], scores[i], i);
                scoreDisplay.AddScore(score);
            }

            scoreDisplay.DisplayScores();

            Destroy(gameObject);
        }
    }
예제 #2
0
 public void BowlScore(int score)
 {
     //add score to players bowl scores list
     bowlScores.Add(score);
     //determine pinSetter action by sending score to actionMaster
     ActionMaster.Action action = ActionMaster.NextAction(bowlScores);
     pinSetter.PerformAction(action);
     ball.Reset();
     //pass bowl scores to scoreMaster to get Frame scores
     frameScores = ScoreMaster.ScoreCumulative(bowlScores);
     foreach (int i in bowlScores)
     {
         Debug.Log(i.ToString());
     }
     foreach (int i in frameScores)
     {
         Debug.Log(i.ToString());
     }
     scoreDisplay.DisplayScores(bowlScores);
     scoreDisplay.FillFrames(frameScores);
 }