public Vector3 GetBorderSnappingPosition(SNAPPING_DIR snappingDir) { switch (snappingDir) { case SNAPPING_DIR.RIGHT: if (!mapBorderRightSnapper) { Debug.LogWarning("RIGHT BORDER SNAPPER IS NOT BEING ASSIGNED.", this); return(Vector3.zero); } return(mapBorderRightSnapper.GetSnappingPosition()); case SNAPPING_DIR.DOWN: if (!mapBorderBottomSnapper) { Debug.LogWarning("BOTTOM BORDER SNAPPER IS NOT BEING ASSIGNED.", this); return(Vector3.zero); } return(mapBorderBottomSnapper.GetSnappingPosition()); default: Debug.LogWarning("NO SUCH DIR OF SNAPPER EXISTS IN MAP GRID"); return(Vector3.zero); } }
public void ToggleWall(LASER_COLOR wallColor, SNAPPING_DIR wallDir, bool show) { switch (wallDir) { case SNAPPING_DIR.LEFT: leftWall.enabled = show; ApplyWallColor(leftWall, wallColor); break; case SNAPPING_DIR.RIGHT: rightWall.enabled = show; ApplyWallColor(rightWall, wallColor); break; case SNAPPING_DIR.UP: topWall.enabled = show; ApplyWallColor(topWall, wallColor); break; case SNAPPING_DIR.DOWN: bottomWall.enabled = show; ApplyWallColor(bottomWall, wallColor); break; } }
public void SetRotation(SNAPPING_DIR dir) { switch (dir) { case SNAPPING_DIR.LEFT: transform.rotation = Quaternion.Euler(Vector3.zero); transform.position += new Vector3(0.08f, 0.0f, 0.0f); break; case SNAPPING_DIR.RIGHT: transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 180f)); transform.position += new Vector3(-0.10f, 0.02f, 0.0f); break; case SNAPPING_DIR.UP: transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 270f)); transform.position += new Vector3(0.0f, -0.10f, 0.0f); break; case SNAPPING_DIR.DOWN: transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 90f)); transform.position += new Vector3(0.0f, 0.12f, 0.0f); break; } }
public void ToggleBorder(LASER_COLOR color, SNAPPING_DIR borderDir, bool show) { switch (borderDir) { case SNAPPING_DIR.LEFT: leftBorder.Initialization(color); leftBorder.ToggleBorder(show); break; case SNAPPING_DIR.RIGHT: rightBorder.Initialization(color); rightBorder.ToggleBorder(show); break; case SNAPPING_DIR.UP: topBorder.Initialization(color); topBorder.ToggleBorder(show); break; case SNAPPING_DIR.DOWN: bottomBorder.Initialization(color); bottomBorder.ToggleBorder(show); break; } }
public void TogglePortal(bool setOne, SNAPPING_DIR portalDir, bool show) { switch (portalDir) { case SNAPPING_DIR.LEFT: leftPortal.enabled = show; if (setOne) { leftPortal.sprite = portalSetOneSprite; } else { leftPortal.sprite = portalSetTwoSprite; } break; case SNAPPING_DIR.RIGHT: rightPortal.enabled = show; if (setOne) { rightPortal.sprite = portalSetOneSprite; } else { rightPortal.sprite = portalSetTwoSprite; } break; case SNAPPING_DIR.UP: topPortal.enabled = show; if (setOne) { topPortal.sprite = portalSetOneSprite; } else { topPortal.sprite = portalSetTwoSprite; } break; case SNAPPING_DIR.DOWN: bottomPortal.enabled = show; if (setOne) { bottomPortal.sprite = portalSetOneSprite; } else { bottomPortal.sprite = portalSetTwoSprite; } break; } }
public Transform GetBorderTransform(SNAPPING_DIR dir) { switch (dir) { case SNAPPING_DIR.LEFT: return(leftBorder.transform); case SNAPPING_DIR.RIGHT: return(rightBorder.transform); case SNAPPING_DIR.UP: return(topBorder.transform); case SNAPPING_DIR.DOWN: return(bottomBorder.transform); default: return(default); } }
public Vector3 GetPortalSnappingPosition(SNAPPING_DIR snappingDir) { switch (snappingDir) { case SNAPPING_DIR.UP: if (!mapPortalUpSnapper) { Debug.LogWarning("UP PORTAL SNAPPER IS NOT BEING ASSIGNED.", this); return(Vector3.zero); } return(mapPortalUpSnapper.GetSnappingPosition()); case SNAPPING_DIR.DOWN: if (!mapPortalBottomSnapper) { Debug.LogWarning("BOTTOM PORTAL SNAPPER IS NOT BEING ASSIGNED.", this); return(Vector3.zero); } return(mapPortalBottomSnapper.GetSnappingPosition()); case SNAPPING_DIR.LEFT: if (!mapPortalLeftSnapper) { Debug.LogWarning("LEFT PORTAL SNAPPER IS NOT BEING ASSIGNED.", this); return(Vector3.zero); } return(mapPortalLeftSnapper.GetSnappingPosition()); case SNAPPING_DIR.RIGHT: if (!mapPortalRightSnapper) { Debug.LogWarning("RIGHT PORTAL SNAPPER IS NOT BEING ASSIGNED.", this); return(Vector3.zero); } return(mapPortalRightSnapper.GetSnappingPosition()); default: Debug.LogWarning("NO SUCH DIR OF SNAPPER EXISTS IN MAP GRID"); return(Vector3.zero); } }