-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTower.cs
More file actions
35 lines (30 loc) · 925 Bytes
/
Tower.cs
File metadata and controls
35 lines (30 loc) · 925 Bytes
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class Tower : MonoBehaviour
{
public enum TargetPriority
{
First,
Close,
Strong
}
[Header("Info")]
public float range;
protected List<Enemy> currentEnemiesInRange = new List<Enemy>();
protected Enemy currentEnemy;
public TargetPriority targetPriority;
public bool rotateTowardsTarget;
[Header("Attacking")]
public float attackRate;
protected float lastAttackTime;
public GameObject projectilePrefab;
public Transform projectileSpawnPos;
public int projectileDamage;
public float projectileSpeed;
protected abstract void Update();
protected abstract Enemy GetEnemy();
protected abstract void Attack();
protected abstract void OnTriggerEnter(Collider other);
protected abstract void OnTriggerExit(Collider other);
}