// Find reference of ScoreboardController and assign to _scoreboardController
 private void _GetScoreboardController()
 {
     GameObject scoreboardControllerObject = GameObject.FindGameObjectWithTag("ScoreboardController");
     if ( scoreboardControllerObject != null )
     {
         this._scoreboardController = scoreboardControllerObject.GetComponent<ScoreboardController>();
     }
     if ( scoreboardControllerObject == null )
     {
         Debug.Log("Cannot find 'ScoreboardController' script");
     }
 }
    void Start()
    {
        StartCoroutine(SpawnWaves());

        // Find reference of ScoreboardController and assign to _scoreboardController
        GameObject scoreboardControllerObject = GameObject.FindGameObjectWithTag("ScoreboardController");
        if (scoreboardControllerObject != null)
        {
            _scoreboardController = scoreboardControllerObject.GetComponent<ScoreboardController>();
        }
        if (scoreboardControllerObject == null)
        {
            Debug.Log("Cannot find 'ScoreboardController' script");
        }
    }
Example #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            ScoreboardController scoreboard = new ScoreboardController();

            Controls.Add(scoreboard.getView());

            int aantalTeerlingen = 3;

            List<TeerlingController> teerlingen = new List<TeerlingController>();

            //doe alle teerlingen in een list
            for (int teerlingNr = 0; teerlingNr < aantalTeerlingen; ++teerlingNr)
            {
                TeerlingController newTeerling = new TeerlingController(scoreboard);
                teerlingen.Add(newTeerling);
            }

            //voeg teerlingen aan formulier
            for (int teerlingNr = 0; teerlingNr < aantalTeerlingen; ++teerlingNr)
            {

                TeerlingView thisView = teerlingen[teerlingNr].getView();
                int xPos = thisView.Width * teerlingNr;
                thisView.Location = new Point(xPos, 50);

                Controls.Add(thisView);

            }

            this.Width = aantalTeerlingen * teerlingen[1].getView().Width;

            WerpController werpCtrl = new WerpController();
            WerpView werpView = werpCtrl.getView();
            werpView.Location = new Point((this.Width / 2) - (werpView.Width / 2), 350);

            //load teerlingen in werper model
            werpCtrl.addTeerlingen(teerlingen);

            Controls.Add(werpView);
        }
Example #4
0
 void Start()
 {
     scoreboardController = GameObject.Find("ScoreboardController").GetComponent<ScoreboardController>();
     teamScoreboard = GameObject.Find("TeamScores").GetComponent<Text>();
 }
 public TeerlingView(TeerlingController teerlingCtrl, ScoreboardController scoreboardCtrl)
 {
     _controllerTeerling = teerlingCtrl;
     _controllerScore = scoreboardCtrl;
     InitializeComponent();
 }