protected void MoveCape(CapeTile prevPiece, int newVerticalLayer, Vector3Int direction) { Vector3 myOldPosition = transform.position; transform.position += direction; if (prevPiece != null) { RotateFrontTowards(prevPiece); } int oldVerticalLayer = VerticalLayer; VerticalLayer = newVerticalLayer; if (NextCapePiece != null) { if (NextCapePiece.HadWeightOnTop) { NextCapePiece.HadWeightOnTop = false; SnapNextCapePiece(); Level.DropAllVerticalLayers(); } else { NextCapePiece.MoveCape(this, oldVerticalLayer, Vector3Int.RoundToInt(myOldPosition - NextCapePiece.transform.position)); UpdateGeometryVariantBasedOnNextPiece(); UpdateModel(); } } else { Level.DropAllVerticalLayers(); } }
public void MarkWeightsForMove() { if (IsWeightOnTop()) { HadWeightOnTop = true; } else if (NextCapePiece != null) { NextCapePiece.MarkWeightsForMove(); } }
public bool IsConnectedToTile(Vector3Int coords) { if (TileCoordinates == coords) { return(true); } if (NextCapePiece != null) { return(NextCapePiece.IsConnectedToTile(coords)); } return(false); }
public bool HasLadyOnTop() { if (Level.TileHasComponent <Lady>(this.TileCoordinates)) { return(true); } if (NextCapePiece != null) { return(NextCapePiece.HasLadyOnTop()); } return(false); }