예제 #1
0
    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);
        }
    }
예제 #2
0
    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;
        }
    }
예제 #3
0
    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;
        }
    }
예제 #4
0
    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;
        }
    }
예제 #5
0
    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;
        }
    }
예제 #6
0
    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);
        }
    }
예제 #7
0
    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);
        }
    }