Ejemplo n.º 1
0
 public void FSCallback(FloatScore fs)
 {
     score += fs.score;
 }
Ejemplo n.º 2
0
    void ScoreManager(ScoreEvent sEvt)
    {
        List<Vector3> fsPts;

        switch( sEvt ){

        case ScoreEvent.draw:
        case ScoreEvent.gameWin:
        case ScoreEvent.gameLoss:
            chain = 0;
            score += scoreRun;
            scoreRun= 0;
            if(fsRun != null){

                fsPts = new List<Vector3>();
                fsPts.Add(fsPosRun);
                fsPts.Add(fsPosMid2);
                fsPts.Add(fsPosEnd);
                fsRun.reportFinishTo = Scoreboard.S.gameObject;
                fsRun.Init(fsPts, 0, 1);
                fsRun.fontSize = new List<float>(new float[] {28, 36, 4});
                fsRun = null;

            }
            break;

        case ScoreEvent.mine:
            chain++;
            scoreRun += chain;
            FloatScore fs;
            Vector3 p0 = Input.mousePosition;
            p0.x /= Screen.width;
            p0.y /= Screen.height;
            fsPts = new List<Vector3>();
            fsPts.Add(p0);
            fsPts.Add(fsPosMid);
            fsPts.Add(fsPosRun);
            fs = Scoreboard.S.CreateFloatingScore(chain,fsPts);
            fsRun.fontSize = new List<float>(new float[] {4, 50, 28});
            if(fsRun == null){

                fsRun = fs;
                fsRun.reportFinishTo = null;

            } else
                fs.reportFinishTo = fsRun.gameObject;

            break;

        }

        switch( sEvt ){

        case ScoreEvent.gameWin:
            GTGameOver.text = "Round Over";
            Prospector.SCORE_FROM_PREVIOUS_ROUND = score;
            print ("You won this round! Round Score: " + score);
            GTRoundResult.text = "You won this round!\nRound Score: " + score;
            break;

        case ScoreEvent.gameLoss:
            GTGameOver.text = "Game Over";
            if(Prospector.HIGH_SCORE <= score){

                print("You got the high score! High Score:" + score);
                GTRoundResult.text = "You got the the high score! \n High Score: " + score;
                Prospector.HIGH_SCORE = score;
                PlayerPrefs.SetInt("ProspectorHighScore", score);

            } else{

                print ("Score: " + score + "ScoreRun: " + scoreRun + " chain: " + chain);
                GTRoundResult.text = "Your final score was: " + score;

            }

            ShowResultGTs(true);
            break;

        }
    }