using Core.Health;
using TowerDefense.Towers;
using UnityEngine;
namespace TowerDefense.Affectors
{
///
/// A class for providing information on to whether
/// the children classes effects are valid
///
public abstract class Affector : MonoBehaviour
{
///
/// Short description for affector for displaying in the UI
///
public string description;
///
/// Gets or sets the alignment
///
public IAlignmentProvider alignment { get; protected set; }
///
/// The physics mask to check against
///
public LayerMask enemyMask { get; protected set; }
///
/// 设置当前Affector对应的兵线ID.
///
public int waveLineID { get; set; }
///
/// 当前Affactor对应的Tower指针.
///
public Tower towerPtr { get; set; }
///
/// Initializes the effect with search data
///
///
/// The alignment of the effect for search purposes
///
///
/// The physics layer of to search for
///
public virtual void Initialize(IAlignmentProvider affectorAlignment, LayerMask mask)
{
alignment = affectorAlignment;
enemyMask = mask;
}
///
/// 返回可能存在的Targetter.
///
///
public virtual TowerDefense.Targetting.Targetter GetTargetter()
{
return null;
}
///
/// Initializes the effect with search data
///
///
/// The alignment of the effect for search purposes
///
public virtual void Initialize(IAlignmentProvider affectorAlignment)
{
Initialize(affectorAlignment, -1);
}
}
}