Exemplo n.º 1
0
    public LevelGenerator(TreadmillBehaviour treadmill)
    {
        this.factory = new ObstacleFactory ();
        this.treadmill = treadmill;

        this.pendingObstacles = new Queue ();

        this.rnd = new System.Random ();
    }
Exemplo n.º 2
0
    void Start()
    {
        this.player = GameObject.FindGameObjectWithTag("Player");

        this.treadmillBehaviour = (TreadmillBehaviour)GameObject.Find ("Treadmill").GetComponent("TreadmillBehaviour");

        this.levelGenerator = new LevelGenerator( this.treadmillBehaviour );
        this.gameRunning = true;

        // Score TextMesh
        GameObject scoreText = GameObject.Find("ScoreText");
        this.scoreText = scoreText.GetComponent(typeof(TextMesh)) as TextMesh;

        // Listen for coin collection event
        this.playerBehaviour = this.player.GetComponent("PlayerBehaviour") as PlayerBehaviour;
        this.playerBehaviour.coinCollected += new PlayerBehaviour.CoinCollectedHandler( HandleCoinsCollected );
        this.playerBehaviour.SetTreadmill(this.treadmillBehaviour);
    }
Exemplo n.º 3
0
 public void SetTreadmill(TreadmillBehaviour treadmill)
 {
     this.treadmill = treadmill;
 }