Пример #1
0
    void Start()
    {
        completedCoolTime        = false;
        coolTimeImage.fillAmount = 0;

        VariableLoader variableLoader = ServiceLocator.Get <VariableLoader>();

        if (variableLoader.useGoogleSheets)
        {
            //limit = (int) variableLoader.TrashCanStats["TrashLimit"];
            totalCoolTime = variableLoader.TrashCanStats["Cooldown"];
            healValue     = variableLoader.TrashCanStats["AmountCollected"];
        }

        ///////////  Upgrades - Trash Spawn Rate Improved  ///////////
        int level = ServiceLocator.Get <GameManager>().upgradeLevelsDictionary[UpgradeMenu.Upgrade.TrashSpawnRate];
        UpgradesIdentifier upgradesIdentifier = ModelManager.UpgradesModel.GetUpgradeEnum(UpgradeMenu.Upgrade.TrashSpawnRate, level);

        coolTimeBeforeUpgrade = totalCoolTime;
        if (level >= 1)
        {
            totalCoolTime       -= ModelManager.UpgradesModel.GetRecord(upgradesIdentifier).ModifierValue;
            coolTimeAfterUpgrade = totalCoolTime;
        }
        tutorial2 = GameObject.FindObjectOfType <Tutorial2>()?.GetComponent <Tutorial2>();
    }
Пример #2
0
    private void Start()
    {
        VariableLoader variableLoader = ServiceLocator.Get <VariableLoader>();

        if (variableLoader.useGoogleSheets)
        {
            healValue = variableLoader.TrashCanStats["Cooldown"];
        }
    }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of <see cref="CreateSpreadsheetDialog"/>.
        /// </summary>
        /// <param name="webProvider">The <see cref="ExcelAllGrade.controller.WebAdapterProvider"/> necessary for the connection with the server.</param>
        /// <param name="vLoader">The <see cref="ExcelAllGrade.controller.VariableLoader"/> to load the variables.</param>
        /// <param name="eVariablesLoaded">The <see cref="System.Threading.AutoResetEvent"/> to indicate when <see cref="ExcelAllGrade.controller.VariableLoader"/> is done loading.</param>
        /// <param name="teacher">The <c>teacher-token</c>.</param>
        public ManageLessonsDialog(string teacher, WebAdapterProvider webProvider, VariableLoader vLoader, AutoResetEvent eVariablesLoaded)
        {
            InitializeComponent();

            this.teacher = teacher;
            this.webProvider = webProvider;
            this.vLoader = vLoader;
            this.eVariablesLoaded = eVariablesLoaded;

            loadingThread = new Thread(new ThreadStart(initializeVariables));
        }
Пример #4
0
    private void Start()
    {
        poisonArea.SetActive(false);
        VariableLoader variableLoader = ServiceLocator.Get <VariableLoader>();

        if (variableLoader.useGoogleSheets)
        {
            _skunksPoisonDamage = variableLoader.EnemyStats["Skunks"]["Damage"];
            _skunksPoisonRange  = variableLoader.EnemyStats["Skunks"]["Range"];
            skunkCooldown       = variableLoader.EnemyStats["Skunks"]["CoolDown"];
        }
    }
Пример #5
0
    public void LoadTowerHP()
    {
        if (isVaribableLoaded)
        {
            return;
        }
        VariableLoader variableLoader = ServiceLocator.Get <VariableLoader>();

        if (variableLoader.useGoogleSheets)
        {
            _houseHP = variableLoader.TowerStats["Health"];
        }
        isVaribableLoaded = true;
    }
Пример #6
0
    private IEnumerator IntializeCoreSystems(Transform systemsParent)
    {
        // Setup Core Systems
        //Debug.Log("Loading Core Systems");

        GameObject _AudioInstance = GameObject.Instantiate(audioPrefeb);

        _AudioInstance.transform.SetParent(systemsParent);
        _AudioInstance.SetActive(false);
        AudioManager AudioManagerComp = _AudioInstance.GetComponent <AudioManager>();

        ServiceLocator.Register <AudioManager>(AudioManagerComp);

        GameObject gameManagerGO = new GameObject("GameManager");

        gameManagerGO.transform.SetParent(systemsParent);
        var gameManagerComp = gameManagerGO.AddComponent <GameManager>();

        ServiceLocator.Register <GameManager>(gameManagerComp.Initialize());

        GameObject levelManagerGO = new GameObject("LevelManager");

        levelManagerGO.transform.SetParent(systemsParent);
        var levelManagerComp = levelManagerGO.AddComponent <LevelManager>();

        ServiceLocator.Register <LevelManager>(levelManagerComp.Initialize());

        GameObject _UIInstance = GameObject.Instantiate(_UIPrefeb);

        _UIInstance.transform.SetParent(systemsParent);
        _UIInstance.SetActive(false);
        UIManager UIManagerComp = _UIInstance.GetComponent <UIManager>();

        ServiceLocator.Register <UIManager>(UIManagerComp.Initialize());

        //GameObject _upgradeInstance = GameObject.Instantiate(upgradeStatPrefeb);
        //_upgradeInstance.transform.SetParent(systemsParent);
        //UpgradeStats upgradeComp = _upgradeInstance.GetComponent<UpgradeStats>();
        //ServiceLocator.Register<UpgradeStats>(upgradeComp.Initialize());

        GameObject _variableLoaderInstance = GameObject.Instantiate(variableLoaderPrefab);

        _variableLoaderInstance.transform.SetParent(systemsParent);
        VariableLoader variableLoader = _variableLoaderInstance.GetComponent <VariableLoader>();

        ServiceLocator.Register <VariableLoader>(variableLoader.Initialize());

        yield return(null);
    }
Пример #7
0
    void Start()
    {
        ResetPlayer();
        poisonAttack.SetActive(false);
        poisonIndicator.SetActive(false);
        poison.SetActive(_ispoisoned);
        _maxHealth = health;
        InvokeRepeating("IncrementUltCharge", 10.0f, ultimateChargeTime);
        audioSource  = GetComponent <AudioSource>();
        audioManager = ServiceLocator.Get <AudioManager>();

        ultimateChargeStart = _ultimateCharge;
        _uiManager          = ServiceLocator.Get <UIManager>();
        //attack = PlayerPrefs.GetFloat(DAMAGE_KEY, 20.0f);
        //health = PlayerPrefs.GetFloat(HEALTH_KEY, 100.0f);

        VariableLoader variableLoader = ServiceLocator.Get <VariableLoader>();

        if (variableLoader.useGoogleSheets)
        {
            _maxHealth   = variableLoader.PlayerStats["HP"];
            healedByItem = variableLoader.PickUpStats["HealAmount"];

            attack      = variableLoader.PlayerAbilties["Attack"]["Damage"];
            attackRange = variableLoader.PlayerAbilties["Attack"]["Range"];

            initialPoisonAttackDamage = variableLoader.PlayerAbilties["Poison"]["Damage"];
            poisonRange = variableLoader.PlayerAbilties["Poison"]["Range"];

            stunRange = variableLoader.PlayerAbilties["Stun"]["Range"];

            ultimateDamage = variableLoader.PlayerAbilties["Ultimate"]["Damage"];
            ultimateRange  = variableLoader.PlayerAbilties["Ultimate"]["Range"];
        }
        ///////////  Upgrades - Improved Player HP  ///////////
        int level = ServiceLocator.Get <GameManager>().upgradeLevelsDictionary[UpgradeMenu.Upgrade.ImprovedPlayerHP];
        UpgradesIdentifier upgradesIdentifier = ModelManager.UpgradesModel.GetUpgradeEnum(UpgradeMenu.Upgrade.ImprovedPlayerHP, level);

        if (level >= 1)
        {
            _maxHealth += ModelManager.UpgradesModel.GetRecord(upgradesIdentifier).ModifierValue;
        }

        health = _maxHealth;
        _uiManager.UpdatePlayerHealth(health, _maxHealth);
        animator = GetComponent <Animator>();
    }
Пример #8
0
    public void Initialize(EnemySpawner.EnemyPath path, Action Recycle, Order order = Order.Tower)
    {
        poison.SetActive(_isPoisoned);
        _Path       = path;
        killed     += Recycle;
        _DataLoader = ServiceLocator.Get <DataLoader>();
        _EnemyData  = _DataLoader.GetDataSourceById(_DataSource) as JsonDataSource;

        _Name = System.Convert.ToString(_EnemyData.DataDictionary["Name"]);

        _Order = order;

        _Agent       = GetComponent <NavMeshAgent>();
        _Agent.speed = _Speed;
        _IsDead      = false;

        //Reset Variable
        health = MaxHealth;
        healthBar.fillAmount   = health / MaxHealth;
        CooltimeBar.fillAmount = 0;
        rigid            = gameObject.GetComponent <Rigidbody>();
        _targetIndicator = transform.Find("TargetIndicator").gameObject;

        gameObject.GetComponent <Enemy>().SwitchOnTargetIndicator(false);
        _isDetected = false;
        _IsAttacked = false;
        _isPoisoned = false;

        waitDelay = _waitForsecondOfCrows;

        VariableLoader variableLoader = ServiceLocator.Get <VariableLoader>();

        if (variableLoader.useGoogleSheets)
        {
            MaxHealth         = variableLoader.EnemyStats[_Name]["HP"];
            _Speed            = variableLoader.EnemyStats[_Name]["Speed"];
            _Attack           = variableLoader.EnemyStats[_Name]["Steal"];
            _Attack           = variableLoader.EnemyStats[_Name]["Damage"];
            _AttackCoolTime   = variableLoader.EnemyStats[_Name]["CoolDown"];
            _enemyAttackRange = variableLoader.EnemyStats[_Name]["Range"];

            health = MaxHealth;
            healthBar.fillAmount = health / MaxHealth;
        }
    }
Пример #9
0
    private void Start()
    {
        VariableLoader variableLoader = ServiceLocator.Get <VariableLoader>();

        _player = ServiceLocator.Get <LevelManager>().playerInstance.GetComponent <Player>();
        _tower  = ServiceLocator.Get <LevelManager>().towerInstance.GetComponent <Tower>();
        if (variableLoader.useGoogleSheets)
        {
            moveSpeed   = variableLoader.PlayerStats["Speed"];
            agent.speed = moveSpeed;

            attackCoolDown           = variableLoader.PlayerAbilties["Attack"]["Cooldown"];
            poisonAttackCoolDown     = variableLoader.PlayerAbilties["Poison"]["Cooldown"];
            intimidateAttackCoolDown = variableLoader.PlayerAbilties["Stun"]["Cooldown"];
        }
        hapticPoisonAbility     = poisonUIbutton.gameObject.GetComponent <HapticFeedback>();
        hapticIntimidateAbility = intimidateUIbutton.gameObject.GetComponent <HapticFeedback>();
        hapticUltAbility        = ultUIbutton.gameObject.GetComponent <HapticFeedback>();
    }
Пример #10
0
    private void Start()
    {
        uiManager = ServiceLocator.Get <UIManager>();
        VariableLoader variableLoader = ServiceLocator.Get <VariableLoader>();

        if (variableLoader.useGoogleSheets)
        {
            MaxHealth          = variableLoader.TowerStats["Health"];
            towerHealCostValue = variableLoader.TowerStats["PlayerHeal"];
            towerLostCostValue = variableLoader.TowerStats["TrashCost"];

            fullHealth = MaxHealth;
        }
        ///////////  Upgrades - Improved healing  ///////////
        int level = ServiceLocator.Get <GameManager>().upgradeLevelsDictionary[UpgradeMenu.Upgrade.ImprovedHealing];
        UpgradesIdentifier upgradesIdentifier = ModelManager.UpgradesModel.GetUpgradeEnum(UpgradeMenu.Upgrade.ImprovedHealing, level);

        towerHealBeforeUpgrade = towerHealCostValue;
        if (level >= 1)
        {
            towerHealCostValue   += ModelManager.UpgradesModel.GetRecord(upgradesIdentifier).ModifierValue;
            towerHealAfterUpgrade = towerHealCostValue;
        }
        fullHealth = ServiceLocator.Get <GameManager>()._houseHP;

        ///////////  Upgrades - Long Ranged Upgrade  ///////////
        int rangedLevel = ServiceLocator.Get <GameManager>().upgradeLevelsDictionary[UpgradeMenu.Upgrade.Ranged] - 1;

        upgradesIdentifier = ModelManager.UpgradesModel.GetUpgradeEnum(UpgradeMenu.Upgrade.Ranged, rangedLevel + 1);
        rangeBeforeUpgrade = range;
        if (rangedLevel >= 0 && gameObject.CompareTag("Tower"))
        {
            range            += ModelManager.UpgradesModel.GetRecord(upgradesIdentifier).ModifierValue;// upgradeStats.towerRange[rangedLevel];
            rangeAfterUpgrade = range;
        }

        tutorial2               = FindObjectOfType <Tutorial2>()?.GetComponent <Tutorial2>();
        hapticFeedback          = GetComponent <HapticFeedback>();
        animatorHealthSignifier = signifierGO != null?signifierGO.GetComponent <Animator>() : null;
    }
Пример #11
0
    private void Start()
    {
        characterSound = GetComponent <ICharacterSound>();
        VariableLoader variableLoader = ServiceLocator.Get <VariableLoader>();

        if (variableLoader.useGoogleSheets)
        {
            health     = variableLoader.BarriacdeStats["Health"];
            _MaxHealth = variableLoader.BarriacdeStats["Health"];
            // _barricadeBuildTime = variableLoader.BarriacdeStats["BuildTime"];
        }
        ///////////  Upgrades - Improved Barricades  ///////////
        int level = ServiceLocator.Get <GameManager>().upgradeLevelsDictionary[UpgradeMenu.Upgrade.ImprovedBarricades];
        UpgradesIdentifier upgradesIdentifier = ModelManager.UpgradesModel.GetUpgradeEnum(UpgradeMenu.Upgrade.ImprovedBarricades, level);

        if (level >= 1 && ServiceLocator.Get <GameManager>().upgradeEnabled[UpgradeMenu.Upgrade.ImprovedBarricades])
        {
            health += ModelManager.UpgradesModel.GetRecord(upgradesIdentifier).ModifierValue;
        }

        healthBarGO.transform.rotation = Quaternion.LookRotation(-Camera.main.transform.forward, Camera.main.transform.up);
    }
Пример #12
0
    private void Start()
    {
        characterSound = GetComponent <ICharacterSound>();

        lockCoolTimeImage.gameObject.SetActive(false);
        VariableLoader variableLoader = ServiceLocator.Get <VariableLoader>();

        if (variableLoader.useGoogleSheets)
        {
            baseBarricadeCost = variableLoader.BarriacdeStats["TrashCost"];
            spawnCoolDownTime = variableLoader.BarriacdeStats["CooldownTime"];
        }
        ServiceLocator.Get <GameManager>().barricadeSpawner = this;

        ///////////  Upgrades - Barricade Spawn Rate Improved  ///////////
        int level = ServiceLocator.Get <GameManager>().upgradeLevelsDictionary[UpgradeMenu.Upgrade.BarricadeSpawnRate];

        spawnCoolDownBeforeUpgrade = spawnCoolDownTime;
        UpgradesIdentifier upgradesIdentifier = ModelManager.UpgradesModel.GetUpgradeEnum(UpgradeMenu.Upgrade.BarricadeSpawnRate, level);

        if (level >= 1)
        {
            spawnCoolDownTime        -= ModelManager.UpgradesModel.GetRecord(upgradesIdentifier).ModifierValue;
            spawnCoolDownAfterUpgrade = spawnCoolDownTime;
        }

        ///////////  Upgrades - Barricade Reduction Cost Upgrade ///////////
        int barricadeLevel = ServiceLocator.Get <GameManager>().upgradeLevelsDictionary[UpgradeMenu.Upgrade.BarricadeReductionCost];

        upgradesIdentifier = ModelManager.UpgradesModel.GetUpgradeEnum(UpgradeMenu.Upgrade.BarricadeReductionCost, barricadeLevel);
        costBeforeUpgrade  = baseBarricadeCost;
        if (barricadeLevel >= 1)
        {
            baseBarricadeCost -= ModelManager.UpgradesModel.GetRecord(upgradesIdentifier).ModifierValue;
            costAfterUpgrade   = baseBarricadeCost;
        }
        signifier.transform.rotation = Quaternion.LookRotation(Camera.main.transform.forward, Camera.main.transform.up);
    }