Exemplo n.º 1
0
    private void LoadComponents()
    {
        _netWorking = new NetWorking();
        _notyfy     = new Notyfy();
        _drawUI     = new DrawUI();

        _drawUI.GameHandler = this;
        _enemy                = EnemyGameObject.GetComponent <Enemy>();
        _enemyHandler         = EnemyGameObject.GetComponent <EnemyHandler>();
        _animatorDefeatNotyfy = DefeatNotyfy.GetComponent <Animator>();
        _animatorWinNotyfy    = WinNotyfy.GetComponent <Animator>();
        _rewardAD             = GetComponent <RewardAD>();
        _enemyHandler.Damage  = Damage;
        TimeHandle.Power(TimeGame);

        _enemyHandler.Notify += ChangeHealth;
        TimeHandle.OnChanges += SendNotifyEndTime;
        _rewardAD.Notify     += Reward;

        if (PlayerPrefs.HasKey("Record"))
        {
            Best = PlayerPrefs.GetInt("Record");
        }
    }