From 175dbbe7c56591febf37950eb75001104685f7c0 Mon Sep 17 00:00:00 2001 From: ProtoSharkk Date: Tue, 22 Oct 2024 13:02:35 -0700 Subject: [PATCH] Distance indicator is mostly accurate with a 2.8x scale multiplier --- Assets/Scenes/SampleScene.unity | 5 +++++ Assets/ShopButton.cs | 2 +- Assets/UI overlay/DistanceIndicator.cs | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 15b3bcf..e1de3dd 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -319,6 +319,10 @@ PrefabInstance: propertyPath: dashDistance value: 1000 objectReference: {fileID: 0} + - target: {fileID: 6118034672792182209, guid: e05928a0d673caf999d31b31b994a112, type: 3} + propertyPath: swingDistance + value: 1 + objectReference: {fileID: 0} - target: {fileID: 6118034672792182209, guid: e05928a0d673caf999d31b31b994a112, type: 3} propertyPath: distanceIndicator value: @@ -1131,6 +1135,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 23dc3f32eba4c9e5aad24589fdbfa30c, type: 3} m_Name: m_EditorClassIdentifier: + multiplier: 2.8 --- !u!212 &1891545564 SpriteRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/ShopButton.cs b/Assets/ShopButton.cs index 84e2699..326a0c7 100644 --- a/Assets/ShopButton.cs +++ b/Assets/ShopButton.cs @@ -16,7 +16,7 @@ public class ShopButton : MonoBehaviour player.swingRange += 1; } else if (upgrade == "attackDistance") { - player.swingDistance += 30; + player.swingDistance += 0.5F; } else if (upgrade == "attackDamage") { player.damageStrength += 5; diff --git a/Assets/UI overlay/DistanceIndicator.cs b/Assets/UI overlay/DistanceIndicator.cs index 9aabc3c..e3e60e2 100644 --- a/Assets/UI overlay/DistanceIndicator.cs +++ b/Assets/UI overlay/DistanceIndicator.cs @@ -2,6 +2,7 @@ using UnityEngine; public class DistanceIndicator : MonoBehaviour { + public float multiplier; Teo player; // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() @@ -13,6 +14,6 @@ public class DistanceIndicator : MonoBehaviour void Update() { Debug.Log(player.swingDistance); - transform.localScale = new Vector3 (player.swingDistance*0.2F, player.swingDistance*0.2F, 1); + transform.localScale = new Vector3 (player.swingDistance*multiplier, player.swingDistance*multiplier, 1); } }