예제 #1
0
    public static void DecreaseGridSize()
    {
        if (instance == null)
        {
            return;
        }

        float inc = EditorPrefs.HasKey(pg_Constant.BracketIncreaseValue) ? EditorPrefs.GetFloat(pg_Constant.BracketIncreaseValue) : .25f;
        float val = pg_Util.Snap(instance.snapValue / instance.SnapUnitValue(instance.snapUnit) - inc, .0001f);

        instance.SetSnapValue(instance.snapUnit, Mathf.Clamp(val, inc, Mathf.Infinity));
        instance.Repaint();
    }
예제 #2
0
    public static void DecreaseGridSize()
    {
        if (instance == null)
        {
            return;
        }

        int   multiplier = EditorPrefs.HasKey(pg_Constant.SnapMultiplier) ? EditorPrefs.GetInt(pg_Constant.SnapMultiplier) : 100;
        float val        = EditorPrefs.HasKey(pg_Constant.SnapValue) ? EditorPrefs.GetFloat(pg_Constant.SnapValue) : 1f;

        multiplier /= 2;

        instance.SetSnapValue(instance.snapUnit, val, multiplier);
        instance.Repaint();
    }