void PropateExplotion(int x, int y, int limit, int xStep, int yStep) { Debug.Log("X: " + x + " Y: " + y); if (limit >= ExplotionRange) { return; } BaseTile tileToCheck = tile.GetNeigbourInDirection(x, y); if (tileToCheck.GetType() == typeof(Wall)) { return; } ExplosionEffect SFX = Instantiate(effect, tileToCheck.transform.position, Quaternion.identity); tileToCheck.AddObjectToTile(SFX); tileToCheck.GetComponent <IDamage>().TakeDamage(Damage); if (xStep == 0 && yStep == 0) { return; } limit++; PropateExplotion(x + xStep, y + yStep, limit, xStep, yStep); }
public bool CanPerform(BaseTile t) { if (t == null) { return(CanPerform()); } bool contains = false; foreach (var f in affectedTypes) { if (f == t.GetType()) { contains = true; } } return(contains && CanPerform()); }
private bool CanBlockLazer(BaseTile tile) { if (tile == null) { return(false); } //if (!(t is NormalTile) && !(t is PorterStartTile)) return true; foreach (var type in blockTileTypes) { if (tile.GetType() == type) { return(true); } if (_rmm?.GetRobot(tile.ParentGrid.ColID, tile.ParentGrid.RowID)) { return(true); } } return(false); }