Exemple #1
0
 // Use this for initialization
 void Start()
 {
     gm       = (GameMode)gameModeObject.GetComponent(typeof(GameMode));
     bc       = (bumpCollision)bumpObject.GetComponent(typeof(bumpCollision));
     timeLeft = gm.getTime();
     updateDistance();
     gameScore  = gm.getScore();
     difficulty = gm.getDifficulity();
     whacked    = false;
 }
    // Update is called once per frame
    void Update()
    {
        bumpCollision bc  = (bumpCollision)camera.GetComponent(typeof(bumpCollision));
        bool          won = bc.getWin();

        //print (won);
        //print ("bgaudioscript" + won);
        if (won == true)
        {
            //print ("win audio");
            AudioSource audio = GetComponent <AudioSource> ();
            audio.Stop();
        }
    }