Esempio n. 1
0
        private void Start()
        {
            GameState.Reset();

            this._inputListener.OnHit += OnHit;

            //choose the random preset index
            int i = Random.Range(0, this._targetsPopsitions.Count);

            //init players and enemies
            PlayerController.Instance.Init(10, this._spawnPopsitions[i], 5);

            EnemyController.Instance.Init(7, 20);
            EnemyController.Instance.OnAllPlayersKilled += GameFailed;

            InitTargetPosition(i);

            //start the timer
            this._timer = Instantiate(new GameObject()).AddComponent <Timer>();
            _timer.InitTimer(60, OnTimeChanged, OnTimerFinish);
        }