1
Fork 0
slime-blood-and-pain/Assets/Scripts/TurnHandler.cs

23 lines
586 B
C#
Raw Normal View History

2019-04-27 20:19:35 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TurnHandler : MonoBehaviour
{
public void OnTurn() {
AI[] ais = gameObject.GetComponentsInChildren<AI>();
foreach(AI ai in ais) {
ai.OnTurn();
}
}
public Entity GetEntityAtPosition(Vector2Int position) {
Entity[] entities = GetComponentsInChildren<Entity>();
foreach(Entity entity in entities) {
if(entity.MapPosition == position) {
return entity;
}
}
return null;
}
}