예제 #1
0
    public void Init(Player player, SacrificeCounts sacrificeCounts)
    {
        this.player = player;
        spanwList   = new List <GameObject>();
        FindSpawn();
        this.sacrificeCounts = sacrificeCounts;

        this.Enemies = new List <Enemy>();

        this.sacrificeCounts.spawnBoss += SpawnBoss;
    }
예제 #2
0
    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();
    }