public void AddEscortableOnTile(PawnInstance escortable) { Tile tile = escortable.GetComponentInParent <Tile>(); if (escortable.GetComponent <Behaviour.Escortable>() == null) { Debug.Log("Can't add escortable to tile, missing component Escortable."); return; } if (escortable.GetComponent <Behaviour.Prisoner>() != null) { Debug.Log("Can't add an escortable with a Prisoner component."); return; } if (tile == null) { Debug.Log("Can't add escortable to tile, no Tile component found in parent."); return; } if (escortablesOnTile.ContainsKey(tile)) { escortablesOnTile[tile].Add(escortable); } else { List <PawnInstance> newList = new List <PawnInstance>(); newList.Add(escortable); escortablesOnTile.Add(tile, newList); } escortable.CurrentTile = tile; }
void LaunchBattle(PawnInstance _aggroTarget) { if (GetComponentInParent <Monster>().BattleOnCollision&& _aggroTarget.GetComponentInParent <Fighter>() != null && _aggroTarget.GetComponentInParent <Fighter>().IsTargetableByMonster == true) { BattleHandler.StartBattleProcess(instance.CurrentTile); GameManager.Instance.UpdateCameraPosition(_aggroTarget); } }
public void AddMonsterOnTile(PawnInstance monster) { Tile tile = monster.GetComponentInParent <Tile>(); if (monster.GetComponent <Behaviour.Monster>() == null) { Debug.Log("Can't add monster to tile, missing component Monster."); return; } if (MonstersOnTile.ContainsKey(tile)) { MonstersOnTile[tile].Add(monster); } else { List <PawnInstance> newList = new List <PawnInstance>(); newList.Add(monster); MonstersOnTile.Add(tile, newList); } monster.CurrentTile = tile; }