public FooterMessage()
    {
        Awake();

        /*
         * Collecting information from other scripts to write in the footer message
         */
        player = GameObject.Find("Player");
        //GameObject TimerObject = GameObject.Find ("Timer");

        /*
         * Player performances changes on each game
         */
//        if (player != null)
        {
            //pointsSystem Scorer = player.GetComponent<pointsSystem>();
            CBGame Scorer = GameObject.Find("GameLogic").GetComponent <CBGame> (); //placeholder, change it with the scipt where the score is kept

            if (Scorer == null)
            {
                score             = 1;      //Scorer.points; //zero score won't show footer info on web portal
                playerPerformance = "Good"; // Resume the performace
                gameLength        = 1000;
            }
            else
            {
                //gameLength = (int) Scorer.duration * 1000;
                //score = Scorer.score; //GameObject.Find ("GameOverPanel").GetComponent<GameOverPanel> ().score;
                playerPerformance = ((score < 50) ? "Good" : "Great!");                 // Resume the performace
                GameObject gop = GameObject.Find("GameOverPanel");
                if (gop != null)
                {
                    playerNotes = gop.GetComponent <GameOverPanel> ().notes.text;
                }
            }
        }

//        if (TimerObject != null)
        {
            //egGame Timer = null; //placeholder, change it with the scipt where the game time is kept
            //if (Timer != null)
            {
                // We transform the game lenght to milliseconds

                /*gameLength = Int32.Parse(Timer.gameLengthInMinutes)*60000;
                *  gameLength += Int32.Parse(Timer.gameLengthInSeconds)*1000;*/
//                gameLength = (int)((RangeParameter)ParameterHandler.Instance.AllParameters[0].GetParameter(egParameterStrings.PHASE_TIMER)).Value * 60 * 1000;
            }
        }
        GetSkeletonData();
    }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     game    = GameObject.Find("GameLogic").GetComponent <CBGame> ();
     enabled = true;
 }