summaryrefslogtreecommitdiff
path: root/GameCode/UpgradeCommander.cs
diff options
context:
space:
mode:
Diffstat (limited to 'GameCode/UpgradeCommander.cs')
-rw-r--r--GameCode/UpgradeCommander.cs47
1 files changed, 0 insertions, 47 deletions
diff --git a/GameCode/UpgradeCommander.cs b/GameCode/UpgradeCommander.cs
deleted file mode 100644
index 015f31b..0000000
--- a/GameCode/UpgradeCommander.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using UnityEngine;
-
-public class UpgradeCommander : MonoBehaviour
-{
- public static UpgradeCommander instance;
-
- public float moveSpeedMultiplicator = 1.5f;
-
- public float effectRadius = 12f;
-
- public float healingInterval = 1f;
-
- public float healingPerSecond = 1f;
-
- private float cooldown;
-
- private TagManager tagManager;
-
- private Transform playerTransform;
-
- private void OnEnable()
- {
- tagManager = TagManager.instance;
- instance = this;
- CommandUnits.instance.PlaceCommandedUnitsAndCalculateTargetPositions();
- CommandUnits.instance.commanding = false;
- PlayerUpgradeManager.instance.commander = true;
- playerTransform = PlayerUpgradeManager.instance.transform;
- }
-
- private void Update()
- {
- cooldown -= Time.deltaTime;
- if (!(cooldown <= 0f))
- {
- return;
- }
- cooldown += healingInterval;
- foreach (TaggedObject playerUnit in tagManager.PlayerUnits)
- {
- if ((playerTransform.position - playerUnit.transform.position).magnitude < effectRadius)
- {
- playerUnit.Hp.Heal(healingPerSecond * healingInterval);
- }
- }
- }
-}