mirror of
https://github.com/Steffo99/octogem.git
synced 2024-11-22 13:04:19 +00:00
45 lines
1 KiB
C#
45 lines
1 KiB
C#
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class Tile : MonoBehaviour
|
|||
|
{
|
|||
|
public TilePosition position;
|
|||
|
public new TileRenderer renderer;
|
|||
|
public List<GenericEffect> effectsOnStep;
|
|||
|
public List<GenericEffect> effectsOnMove;
|
|||
|
|
|||
|
private TileType type;
|
|||
|
|
|||
|
void Awake()
|
|||
|
{
|
|||
|
position = GetComponent<TilePosition>();
|
|||
|
renderer = GetComponent<TileRenderer>();
|
|||
|
}
|
|||
|
|
|||
|
public TileType Type
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
return type;
|
|||
|
}
|
|||
|
|
|||
|
set
|
|||
|
{
|
|||
|
type = value;
|
|||
|
renderer.AnimatorController = type.AnimatorController;
|
|||
|
effectsOnStep = type.effectsOnStep;
|
|||
|
effectsOnMove = type.effectsOnMove;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void SteppedOn(Unit walker)
|
|||
|
{
|
|||
|
effectsOnStep.ForEach(delegate (GenericEffect effect) { walker.ApplyNewEffect(effect); });
|
|||
|
}
|
|||
|
|
|||
|
public void MovedOn(Unit walker)
|
|||
|
{
|
|||
|
effectsOnMove.ForEach(delegate (GenericEffect effect) { walker.ApplyNewEffect(effect); });
|
|||
|
}
|
|||
|
}
|