-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2
More file actions
41 lines (37 loc) · 1.09 KB
/
2
File metadata and controls
41 lines (37 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.Collections;
using UnityEngine;
public class TrapperTower : Tower
{
public GameObject projectilePrefab;
public GameObject projectile;
public Coroutine ActivateTower;
public new void Start()
{
base.Start();
ActivateTower = StartCoroutine(ActiveTower());
// ========= Tower Upgrade Lists =========
damages = new int[3] { 150, 400, 1000 };
timesToDamage = new float[] { 1, 1, 1 };
cooldowns = new float[] { 8, 6, 3.5f };
isSpecials = new bool[] { false, true, true };
radii = new float[] { 150, 250, 350 };
durations = new float[] { 0, 0, 0 };
// =======================================
}
public override void Attack()
{
Debug.Log("Attack");
projectile = Instantiate(projectilePrefab, parent: GetComponent<Transform>());
}
public IEnumerator ActiveTower()
{
while (true)
{
if (targetEnemy != null && canAttack)
{
Attack();
}
yield return new WaitForSeconds(cooldown);
}
}
}