43 lines
837 B
C#
43 lines
837 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 Start()
|
|
{
|
|
}
|
|
|
|
protected virtual void OnDestroy()
|
|
{
|
|
}
|
|
|
|
protected virtual void Update()
|
|
{
|
|
}
|
|
|
|
protected virtual void FixedUpdate()
|
|
{
|
|
}
|
|
}
|