From 676a6935f7384a1b378e130f80f329a00bd1604c Mon Sep 17 00:00:00 2001 From: Sveske Juice Date: Sun, 21 Apr 2024 04:14:39 +0200 Subject: [PATCH] tower col --- Assets/ScriptableObjects/TowerCollection.asset | 7 +++++++ Assets/Scripts/PlacementSystem/CameraSlotClickDetect.cs | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/Assets/ScriptableObjects/TowerCollection.asset b/Assets/ScriptableObjects/TowerCollection.asset index a983a6a..2331f27 100644 --- a/Assets/ScriptableObjects/TowerCollection.asset +++ b/Assets/ScriptableObjects/TowerCollection.asset @@ -21,6 +21,13 @@ MonoBehaviour: price: 250 prefab: {fileID: 1415246146501367120, guid: 91554800af50ec827822f376e2fc5f64, type: 3} + - name: Mr Lazer + price: 500 + prefab: {fileID: 645933633211530419, guid: 4e5e3131ea2a78cfd93219be3806da6d, type: 3} + - name: Tesla + price: 500 + prefab: {fileID: 1328109535653931045, guid: 148ea27cfb89dc0398835d59bed11cca, + type: 3} - name: Black hole price: 500 prefab: {fileID: 4611178744751000815, guid: 1d7949721a9f0bc9ba1a8c49ca5fd099, diff --git a/Assets/Scripts/PlacementSystem/CameraSlotClickDetect.cs b/Assets/Scripts/PlacementSystem/CameraSlotClickDetect.cs index 7355048..cf7e2e0 100644 --- a/Assets/Scripts/PlacementSystem/CameraSlotClickDetect.cs +++ b/Assets/Scripts/PlacementSystem/CameraSlotClickDetect.cs @@ -17,6 +17,14 @@ public class CameraSlotClickDetect : MonoBehaviour { ShootClickRay(); } + if (Input.GetKeyDown(KeyCode.Escape)) + { + GameManager.Instance.SelectedTower = null; + if (towerCam != null) + towerCam.ChangeToTarget(null); + else + Debug.LogWarning("TowerCam scpritet is not assigned, assign in the inspector"); + } ShootHoverRay(); }