示例#1
0
 private void AttackPlayer()
 {
     if (attackDelay.CallDelay())
     {
         player.GetComponent <PlayerManager>().HurtPlayer(playerDamage);
     }
 }
示例#2
0
 /// <summary>
 /// Shoots Dart
 /// </summary>
 private void Shoot()
 {
     if (Input.GetAxis("Shoot") == 1 && fireballDelay.CallDelay())
     {
         TowerManager.ShootDart(transform, rotation);
     }
 }
示例#3
0
 private void shoot()
 {
     if (shootingDelay.CallDelay())
     {
         pooledShooting.ShootProjectile(pooledShooting.dart, shootingDamage, shootingSpeed, transform.position, gunRotation);
     }
 }
示例#4
0
 // Update is called once per frame
 void Update()
 {
     if (logoDelay.CallDelay())
     {
         spriteRenderer.sprite = logoSprites[spriteIndex++];
     }
 }
示例#5
0
 /// <summary>
 /// Called by UPDATE method to have the mana regen
 /// </summary>
 private void ManaRegen()
 {
     if (currentPlayerManaCap > currentPlayerMana && manaDelay.CallDelay())
     {
         currentPlayerMana += manaRegenAmount;
         uiController.UpdatePlayerMana(currentPlayerMana);
     }
 }
示例#6
0
    void Update()
    {
        targetList.RemoveAll(item => item == null); //Removes GameObject from list if it is destroyed before update is called again

        if (punchTowerAnimator.GetBool("Punching") && punchRate.CallDelay())
        {
            foreach (GameObject target in targetList.ToArray())
            {
                target.GetComponent <Health>().HurtGameObject(damage);
            }
        }

        if (targetList.Count == 0)
        {
            punchTowerAnimator.SetBool("Punching", false);
        }
    }
示例#7
0
 /// <summary>
 /// Build a tower
 /// </summary>
 private void BuildTower()
 {
     if (Input.GetAxis("SpellCast") != 0)
     {
         if (axisInUse == false)
         {
             clickDownMousePosition  = mousePosition;
             clickLocationSpriteTemp = Instantiate(clickLocationSprite, new Vector3(Mathf.RoundToInt(mousePosition.x), Mathf.RoundToInt(mousePosition.y), 0), Quaternion.identity);
             axisInUse = true;
         }
     }
     if (Input.GetAxis("SpellCast") == 0 && axisInUse == true && spellCastDelay.CallDelay())
     {
         TowerManager.PlaceTower(currentTower, mousePosition, clickDownMousePosition);
         Destroy(clickLocationSpriteTemp);
         axisInUse = false;
     }
 }
示例#8
0
    /// <summary>
    /// Select which tower is toggled
    /// </summary>
    void TowerSelect()
    {
        if (Input.GetAxis("SpellSelect") == 1 && towerSelectDelay.CallDelay())
        {
            if (currentTower != numberOfTowers - 1)
            {
                currentTower++;
            }
            else
            {
                currentTower = 0;
            }

            TowerToggle(currentTower);
        }
        else if (Input.GetAxis("SpellSelect") == -1 && towerSelectDelay.CallDelay())
        {
            if (currentTower != 0)
            {
                currentTower--;
            }
            else
            {
                currentTower = numberOfTowers - 1;
            }

            TowerToggle(currentTower);
        }
        else if (Input.GetAxis("Spell1") == 1 && towerSelectDelay.CallDelay())
        {
            currentTower = 0;
            TowerToggle(currentTower);
        }
        else if (Input.GetAxis("Spell2") == 1 && towerSelectDelay.CallDelay())
        {
            currentTower = 1;
            TowerToggle(currentTower);
        }
        else if (Input.GetAxis("Spell3") == 1 && towerSelectDelay.CallDelay())
        {
            currentTower = 2;
            TowerToggle(currentTower);
        }
        else if (Input.GetAxis("Spell4") == 1 && towerSelectDelay.CallDelay())
        {
            currentTower = 3;
            TowerToggle(currentTower);
        }
    }