Ejemplo n.º 1
0
    /// <summary>
    /// Integer vector field.
    /// </summary>

    static public Vector4 IntPadding(string prefix, Vector4 v)
    {
        int left   = Mathf.RoundToInt(v.x);
        int top    = Mathf.RoundToInt(v.y);
        int right  = Mathf.RoundToInt(v.z);
        int bottom = Mathf.RoundToInt(v.w);

        WeaponXIToolsEditor.IntVector a = WeaponXIToolsEditor.IntPair(prefix, "Left", "Top", left, top);
        WeaponXIToolsEditor.IntVector b = WeaponXIToolsEditor.IntPair(null, "Right", "Bottom", right, bottom);

        return(new Vector4(a.x, a.y, b.x, b.y));
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Integer rectangle field.
    /// </summary>

    static public Rect IntRect(string prefix, Rect rect)
    {
        int left   = Mathf.RoundToInt(rect.xMin);
        int top    = Mathf.RoundToInt(rect.yMin);
        int width  = Mathf.RoundToInt(rect.width);
        int height = Mathf.RoundToInt(rect.height);

        WeaponXIToolsEditor.IntVector a = WeaponXIToolsEditor.IntPair(prefix, "Left", "Top", left, top);
        WeaponXIToolsEditor.IntVector b = WeaponXIToolsEditor.IntPair(null, "Width", "Height", width, height);

        return(new Rect(a.x, a.y, b.x, b.y));
    }