3DTD/Assets/Scripts/Tower/Tower.cs

39 lines
785 B
C#

using System;
using UnityEngine;
using UnityEngine.Assertions;
public abstract class Tower : MonoBehaviour
{
protected bool selected = false;
protected HealthComponent healthComp;
protected Outline outline;
// Getters
public virtual void TowerSelected(bool selected)
{
this.selected = selected;
outline.enabled = selected;
}
protected virtual void Awake()
{
healthComp = GetComponent<HealthComponent>();
outline = GetComponent<Outline>();
Assert.IsNotNull(healthComp);
Assert.IsNotNull(outline);
}
protected virtual void OnDestroy()
{
}
protected virtual void Update()
{
}
protected virtual void FixedUpdate()
{
}
}