diff --git a/Assets/Prefabs/Towers/BaseTower.prefab b/Assets/Prefabs/Towers/BaseTower.prefab index 7e6154d..ab58f6c 100644 --- a/Assets/Prefabs/Towers/BaseTower.prefab +++ b/Assets/Prefabs/Towers/BaseTower.prefab @@ -152,7 +152,7 @@ MonoBehaviour: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 872127579833310669} - m_Enabled: 1 + m_Enabled: 0 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 5fea29bb7c508c244a1f805a5fd3fc4d, type: 3} m_Name: diff --git a/Assets/Scripts/Manager/GameManager.cs b/Assets/Scripts/Manager/GameManager.cs index 5a33a26..9cc7b66 100644 --- a/Assets/Scripts/Manager/GameManager.cs +++ b/Assets/Scripts/Manager/GameManager.cs @@ -12,7 +12,6 @@ public class GameManager : MonoBehaviour selectedTower = value; selectedTower.TowerSelected(true); - Debug.Log($"Selected: {selectedTower}"); }} private void Awake() diff --git a/Assets/Scripts/PlacementSystem/CameraSlotClickDetect.cs b/Assets/Scripts/PlacementSystem/CameraSlotClickDetect.cs index ecd51ac..d12562c 100644 --- a/Assets/Scripts/PlacementSystem/CameraSlotClickDetect.cs +++ b/Assets/Scripts/PlacementSystem/CameraSlotClickDetect.cs @@ -1,6 +1,5 @@ using System.Collections; using System.Collections.Generic; -using Unity.VisualScripting; using UnityEngine; public class CameraSlotClickDetect : MonoBehaviour diff --git a/Assets/Scripts/Tower/AimTower.cs b/Assets/Scripts/Tower/AimTower.cs index 7bcd357..6c0bad5 100644 --- a/Assets/Scripts/Tower/AimTower.cs +++ b/Assets/Scripts/Tower/AimTower.cs @@ -28,6 +28,8 @@ public class AimTower : Tower protected override void Awake() { + base.Awake(); + horizontalArc.Value.AddListener(UpdateBarrelRotation); verticalArc.Value.AddListener(UpdateBarrelRotation); @@ -80,7 +82,6 @@ public class AimTower : Tower } if (!this.selected) return; - Debug.Log("UPAD"); Vector3 origin = barrel.Tip.position; Vector3 dir = barrel.transform.forward; List pointsInTrajectory = new(); diff --git a/Assets/Scripts/Tower/Tower.cs b/Assets/Scripts/Tower/Tower.cs index 3ddee8e..725fa7b 100644 --- a/Assets/Scripts/Tower/Tower.cs +++ b/Assets/Scripts/Tower/Tower.cs @@ -6,18 +6,22 @@ public abstract class Tower : MonoBehaviour { protected bool selected = false; protected HealthComponent healthComp; + protected Outline outline; // Getters public virtual void TowerSelected(bool selected) { this.selected = selected; + + outline.enabled = selected; } protected virtual void Awake() { healthComp = GetComponent(); + outline = GetComponent(); Assert.IsNotNull(healthComp); - + Assert.IsNotNull(outline); } protected virtual void OnDestroy()