private void CreateCornerWalls(Transform previousOuterPlaceholder, Transform currentOuterPlaceholder, List <GameObject> surroundings) { float side = MathMethod.VectorSign(previousOuterPlaceholder.forward); GameObject sideWall = InstantiateSideWall(currentOuterPlaceholder, side); GameObject backWall = InstantiateBackWall(currentOuterPlaceholder); TrimPreviousOverlap(previousOuterPlaceholder, backWall.transform); TrimSideWallOverlap(previousOuterPlaceholder, backWall.transform, sideWall.transform); surroundings.Add(sideWall); surroundings.Add(backWall); }
private void InstantiateSideWalls(Transform currentPlaceholder, out GameObject leftWall, out GameObject rightWall) { PlaceholderFlag flag = GetFlag(currentPlaceholder); if (flag != null) { float side = MathMethod.VectorSign(flag.OccupiedSide); if (side == 1) { leftWall = InstantiateSideWall(currentPlaceholder, -side); rightWall = null; } else { leftWall = null; rightWall = InstantiateSideWall(currentPlaceholder, -side); } } else { leftWall = InstantiateSideWall(currentPlaceholder, -1); rightWall = InstantiateSideWall(currentPlaceholder, 1); } }