2024-04-19 23:32:37 +02:00
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.Assertions;
|
|
|
|
|
|
|
|
[RequireComponent(typeof(HealthComponent))]
|
|
|
|
public abstract class Tower : MonoBehaviour
|
|
|
|
{
|
2024-04-20 01:40:53 +02:00
|
|
|
[SerializeField] private EditableArc horizontalArc;
|
|
|
|
[SerializeField] private EditableArc verticalArc;
|
2024-04-19 23:32:37 +02:00
|
|
|
|
|
|
|
private HealthComponent healthComp;
|
|
|
|
|
2024-04-20 01:40:53 +02:00
|
|
|
// Getters
|
|
|
|
public Vector2 HorizontalRotationMinMax => horizontalArc.RotationMinMax;
|
|
|
|
public Vector2 VerticalRotationMinMax => verticalArc.RotationMinMax;
|
|
|
|
public float HorizontalRotation => horizontalArc.Value;
|
|
|
|
public float VerticalRotation => verticalArc.Value;
|
|
|
|
|
|
|
|
protected virtual void Awake()
|
2024-04-19 23:32:37 +02:00
|
|
|
{
|
|
|
|
healthComp = GetComponent<HealthComponent>();
|
|
|
|
Assert.IsNotNull(healthComp);
|
|
|
|
|
|
|
|
// Set default rotation to average between min max
|
|
|
|
}
|
|
|
|
}
|