예제 #1
0
    private Vector3 OffsetWorldRotationDependence(Vector3 offset)
    {
        Vector3 newOffset = offset;

        WorldRotation.Rotation rot = Managers.WorldRotation.getRotation();

        switch (rot)
        {
        case WorldRotation.Rotation.FLOOR:

            newOffset = offset;
            break;

        case WorldRotation.Rotation.RIGHT_WALL:

            newOffset = new Vector3(-offset.y, offset.x, offset.z);
            break;

        case WorldRotation.Rotation.LEFT_WALL:

            newOffset = new Vector3(offset.y, -offset.x, offset.z);
            break;

        case WorldRotation.Rotation.ROOF:

            newOffset = new Vector3(offset.x, -offset.y, offset.z);
            break;
        }

        return(newOffset);
    }
 public void OnWorldRotate()
 {
     WorldRotation.Rotation rotation = Managers.WorldRotation.getRotation();
     if (rotation == WorldRotation.Rotation.RIGHT_WALL)
     {
         rayDirectionDown  = Vector3.right;
         rayDirectionLeft  = Vector3.down;
         rayDirectionRight = Vector3.up;
     }
     else if (rotation == WorldRotation.Rotation.LEFT_WALL)
     {
         rayDirectionDown  = Vector3.left;
         rayDirectionLeft  = Vector3.up;
         rayDirectionRight = Vector3.down;
     }
     else if (rotation == WorldRotation.Rotation.ROOF)
     {
         rayDirectionDown  = Vector3.up;
         rayDirectionLeft  = Vector3.right;
         rayDirectionRight = Vector3.left;
     }
     else
     {
         rayDirectionDown  = Vector3.down;
         rayDirectionLeft  = Vector3.left;
         rayDirectionRight = Vector3.right;
     }
 }