using System.Collections.Generic; using UnityEngine; public class Tile : MonoBehaviour { public TilePosition position; public new TileRenderer renderer; public List effectsOnStep; public List effectsOnMove; private TileType type; void Awake() { position = GetComponent(); renderer = GetComponent(); } 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); }); } }