From c76805b98a5d8e2db8779858e9f8afadfac33193 Mon Sep 17 00:00:00 2001 From: Sveske Juice Date: Sat, 20 Apr 2024 17:24:49 +0200 Subject: [PATCH] fix for zhen --- Assets/Scripts/Tower/ProjectileTower.cs | 1 - Assets/Scripts/Tower/Tower.cs | 1 - Assets/Scripts/Utilities/EditableArc.cs | 3 ++- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Tower/ProjectileTower.cs b/Assets/Scripts/Tower/ProjectileTower.cs index ae89b9d..01c0d17 100644 --- a/Assets/Scripts/Tower/ProjectileTower.cs +++ b/Assets/Scripts/Tower/ProjectileTower.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.Assertions; -[RequireComponent(typeof(ProjectileSpawner))] public class ProjectileTower : Tower { [SerializeField, Range(0.01f, 20f)] private float attackSecondsDelay = 1f; diff --git a/Assets/Scripts/Tower/Tower.cs b/Assets/Scripts/Tower/Tower.cs index aeeb8b4..9b21002 100644 --- a/Assets/Scripts/Tower/Tower.cs +++ b/Assets/Scripts/Tower/Tower.cs @@ -1,7 +1,6 @@ using UnityEngine; using UnityEngine.Assertions; -[RequireComponent(typeof(HealthComponent))] public abstract class Tower : MonoBehaviour { public bool towerSelected { get; set; } = true; diff --git a/Assets/Scripts/Utilities/EditableArc.cs b/Assets/Scripts/Utilities/EditableArc.cs index 2b8223f..5a0193d 100644 --- a/Assets/Scripts/Utilities/EditableArc.cs +++ b/Assets/Scripts/Utilities/EditableArc.cs @@ -72,11 +72,12 @@ public class EditableArc : MonoBehaviour Vector3 v1 = SamplePointOnArcAngle(start, end, visualRadius, Value.Value); Vector3 v2 = SamplePointOnArcAngle(start, end, visualRadius, Value.Value + 0.01f); Vector3 arcTangent = v2 - v1; + Debug.DrawRay(knob.transform.position, arcTangent, Color.yellow, 5f); // TODO: figure out this based on camera orientation float sign = -1f; - float delta = Vector2.Dot(arcTangent, Vector2.down * mouseMovement) * knobSensitiviy; + float delta = (Vector2.Dot(arcTangent, Vector2.up * mouseMovement.x) + Vector2.Dot(arcTangent, Vector2.right * mouseMovement.y)) * knobSensitiviy; Debug.Log(delta); float newAngle = ClampAngle(Value.Value + delta, rotationMinMax.x, rotationMinMax.y); Value.Value = newAngle;