Distance indicator is mostly accurate with a 2.8x scale multiplier

This commit is contained in:
2024-10-22 13:02:35 -07:00
parent 80e63019ed
commit 175dbbe7c5
3 changed files with 8 additions and 2 deletions

View File

@@ -319,6 +319,10 @@ PrefabInstance:
propertyPath: dashDistance propertyPath: dashDistance
value: 1000 value: 1000
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6118034672792182209, guid: e05928a0d673caf999d31b31b994a112, type: 3}
propertyPath: swingDistance
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6118034672792182209, guid: e05928a0d673caf999d31b31b994a112, type: 3} - target: {fileID: 6118034672792182209, guid: e05928a0d673caf999d31b31b994a112, type: 3}
propertyPath: distanceIndicator propertyPath: distanceIndicator
value: value:
@@ -1131,6 +1135,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 23dc3f32eba4c9e5aad24589fdbfa30c, type: 3} m_Script: {fileID: 11500000, guid: 23dc3f32eba4c9e5aad24589fdbfa30c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
multiplier: 2.8
--- !u!212 &1891545564 --- !u!212 &1891545564
SpriteRenderer: SpriteRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@@ -16,7 +16,7 @@ public class ShopButton : MonoBehaviour
player.swingRange += 1; player.swingRange += 1;
} }
else if (upgrade == "attackDistance") { else if (upgrade == "attackDistance") {
player.swingDistance += 30; player.swingDistance += 0.5F;
} }
else if (upgrade == "attackDamage") { else if (upgrade == "attackDamage") {
player.damageStrength += 5; player.damageStrength += 5;

View File

@@ -2,6 +2,7 @@ using UnityEngine;
public class DistanceIndicator : MonoBehaviour public class DistanceIndicator : MonoBehaviour
{ {
public float multiplier;
Teo player; Teo player;
// Start is called once before the first execution of Update after the MonoBehaviour is created // Start is called once before the first execution of Update after the MonoBehaviour is created
void Start() void Start()
@@ -13,6 +14,6 @@ public class DistanceIndicator : MonoBehaviour
void Update() void Update()
{ {
Debug.Log(player.swingDistance); 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);
} }
} }