Esempio n. 1
0
        public static void LockScaling(Axis a, ScalingDirection td, float d)
        {
            if (!lockScaling)
            {
                return;
            }

            switch (a)
            {
            case Axis.x:
                xScalingLock.delay     = d;
                xScalingLock.direction = td;
                break;

            case Axis.y:
                yScalingLock.delay     = d;
                yScalingLock.direction = td;
                break;

            case Axis.z:
                zScalingLock.delay     = d;
                zScalingLock.direction = td;
                break;

            default:
                break;
            }
        }
    /// <summary>
    /// Updates Resolution, by changing RenderViewPortScale
    /// </summary>
    /// <param name="dir">Direction to move in</param>
    private void ChangeResolution(ScalingDirection dir)
    {
        float curr = scale;

        if (dir == ScalingDirection.Increase)
        {
            curr += SCALE_STEP;
        }
        else
        {
            curr -= SCALE_STEP;
        }
        curr  = Mathf.Clamp(curr, MIN_SCALE, MAX_SCALE);
        scale = curr;
    }
Esempio n. 3
0
        public static bool ScalingUnlocked(Axis a, ScalingDirection td)
        {
            bool result;

            switch (a)
            {
            case Axis.x:
                result = xScalingLock.direction != td || xScalingLock.delay == 0;
                break;

            case Axis.y:
                result = yScalingLock.direction != td || yScalingLock.delay == 0;
                break;

            case Axis.z:
                result = zScalingLock.direction != td || zScalingLock.delay == 0;
                break;

            default:
                result = true;
                break;
            }
            return(result);
        }
Esempio n. 4
0
 public ScalingLock(ScalingDirection sd, float d) : base(d)
 {
     direction = sd;
 }