void Init() { this.gamePlay = GamePlayTime.Instance; GetElemets(); StartEventHandler(); }
public void Initialize() { DataLoad.InitData(); this.gamePlay = GamePlayTime.Instance; this.gamePlay.Initialize(); PlayerManager.Instance.InstantiatePlayer(); sacrificeCounts = new SacrificeCounts(); this.player = PlayerManager.Instance.player; this.player.sacrificeCounts = this.sacrificeCounts; this.player.LiveChangesEvent += (int arg) => { if (arg <= 0) { GameOver(); } }; enemyManager = EnemyManager.Instance; enemyManager.Init(this.player, this.sacrificeCounts); GameElementConstants.gameState = GameElementConstants.GameState.Start; this.UI = GamePlayManager.Instance; PlayerManager.Instance.player.LiveChangesEvent += this.UI.gamePlay.HUDScreen.playerLivesEventHandler; this.UI.Init(); this.UI.gamePlay.WelcomeScreen.Init(this.UI.gamePlay.TapScreen.TapEvent); this.UI.gamePlay.WelcomeScreen.TapEvent += () => { GameElementConstants.gameState = GameElementConstants.GameState.Playing; EnemyManager.Instance.InstantiateEnemyRandom(); this.match.Init(); this.match.UserInit(); this.gamePlay.PausedEvent += this.match.user.Pause; }; this.match = SelectorMatch.Instance; this.match.MatchedEvent += MatchedEventConnections(); waveMechanic = new SpawnManager(this.enemyManager, this.player); this.gamePlay.SetPause(false); InitializeCombo(); }
public void Initialize() { //Get Singletons; this.gamePlay = GamePlayTime.Instance; this.UIManager = UI.Behaviours.GamePlay.GamePlayManager.Instance; this.playerManager = PlayerManager.Instance; //instantiate player this.playerManager.InstantiatePlayer(); //initialize UI this.UIManager.Init(); this.UIManager.gamePlay.WelcomeScreen.Init(this.UIManager.gamePlay.TapScreen.TapEvent); }
void Awake() { this.gamePlay = GamePlayTime.Instance; }