public void SpawnPiece(Type piece, Cell target) { if (target.IsSolidlyOccupied()) return; GameObject parent = GetPieceParent(piece); GameObject obj = (GameObject)PrefabUtility.InstantiatePrefab(GamePiece.GetPrefab(selectedPiece)); obj.transform.position = target.WorldPos(); obj.transform.parent = parent.transform; RoomManager.roomManager.AddPiece(obj, piece); }
public virtual bool TeleportTo(Cell target) { Cell currentCell = cell; if (target.IsSolidlyOccupied())return false; Detatch(); return StartLerp(currentCell, target, teleportSpeed); }