28 lines
800 B
C#
28 lines
800 B
C#
using UnityEngine;
|
|
using UnityEngine.Assertions;
|
|
|
|
[RequireComponent(typeof(HealthComponent))]
|
|
public abstract class Tower : MonoBehaviour
|
|
{
|
|
[SerializeField] protected EditableArc horizontalArc;
|
|
[SerializeField] protected EditableArc verticalArc;
|
|
|
|
protected HealthComponent healthComp;
|
|
|
|
// 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()
|
|
{
|
|
healthComp = GetComponent<HealthComponent>();
|
|
Assert.IsNotNull(healthComp);
|
|
}
|
|
|
|
protected virtual void OnDestroy()
|
|
{
|
|
}
|
|
}
|