UpdateAnchors() public method

Manually update anchored sides.
public UpdateAnchors ( ) : void
return void
Exemplo n.º 1
0
    public static void MoveRect(UIRect rect, float x, float y)
    {
        int       num             = Mathf.FloorToInt(x + 0.5f);
        int       num2            = Mathf.FloorToInt(y + 0.5f);
        Transform cachedTransform = rect.cachedTransform;

        cachedTransform.localPosition += new Vector3((float)num, (float)num2);
        int num3 = 0;

        if (rect.leftAnchor.target)
        {
            num3++;
            rect.leftAnchor.absolute += num;
        }
        if (rect.rightAnchor.target)
        {
            num3++;
            rect.rightAnchor.absolute += num;
        }
        if (rect.bottomAnchor.target)
        {
            num3++;
            rect.bottomAnchor.absolute += num2;
        }
        if (rect.topAnchor.target)
        {
            num3++;
            rect.topAnchor.absolute += num2;
        }
        if (num3 != 0)
        {
            rect.UpdateAnchors();
        }
    }
Exemplo n.º 2
0
    static int UpdateAnchors(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        UIRect obj = (UIRect)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIRect");

        obj.UpdateAnchors();
        return(0);
    }
Exemplo n.º 3
0
    static int UpdateAnchors(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        UIRect obj = LuaScriptMgr.GetNetObject <UIRect>(L, 1);

        obj.UpdateAnchors();
        return(0);
    }
Exemplo n.º 4
0
 static public int UpdateAnchors(IntPtr l)
 {
     try {
         UIRect self = (UIRect)checkSelf(l);
         self.UpdateAnchors();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 5
0
 static int UpdateAnchors(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UIRect obj = (UIRect)ToLua.CheckObject <UIRect>(L, 1);
         obj.UpdateAnchors();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 6
0
    public static int UpdateAnchors(IntPtr l)
    {
        int result;

        try
        {
            UIRect uIRect = (UIRect)LuaObject.checkSelf(l);
            uIRect.UpdateAnchors();
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemplo n.º 7
0
    private static int UpdateAnchors(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 1);
            UIRect uIRect = (UIRect)ToLua.CheckObject(L, 1, typeof(UIRect));
            uIRect.UpdateAnchors();
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
Exemplo n.º 8
0
    /// <summary>
    /// Adjust the rectangle's position using the specified local delta coordinates.
    /// </summary>

    static public void MoveRect(UIRect rect, float x, float y)
    {
        int ix = Mathf.FloorToInt(x + 0.5f);
        int iy = Mathf.FloorToInt(y + 0.5f);

        Transform t = rect.cachedTransform;

        t.localPosition += new Vector3(ix, iy);
        int anchorCount = 0;

        if (rect.leftAnchor.target)
        {
            ++anchorCount;
            rect.leftAnchor.absolute += ix;
        }

        if (rect.rightAnchor.target)
        {
            ++anchorCount;
            rect.rightAnchor.absolute += ix;
        }

        if (rect.bottomAnchor.target)
        {
            ++anchorCount;
            rect.bottomAnchor.absolute += iy;
        }

        if (rect.topAnchor.target)
        {
            ++anchorCount;
            rect.topAnchor.absolute += iy;
        }

#if UNITY_EDITOR
        NGUITools.SetDirty(rect);
#endif

        // If all sides were anchored, we're done
        if (anchorCount != 0)
        {
            rect.UpdateAnchors();
        }
    }
Exemplo n.º 9
0
	/// <summary>
	/// Adjust the rectangle's position using the specified local delta coordinates.
	/// </summary>

	static public void MoveRect (UIRect rect, float x, float y)
	{
		int ix = Mathf.FloorToInt(x + 0.5f);
		int iy = Mathf.FloorToInt(y + 0.5f);

		Transform t = rect.cachedTransform;
		t.localPosition += new Vector3(ix, iy);
		int anchorCount = 0;

		if (rect.leftAnchor.target)
		{
			++anchorCount;
			rect.leftAnchor.absolute += ix;
		}

		if (rect.rightAnchor.target)
		{
			++anchorCount;
			rect.rightAnchor.absolute += ix;
		}

		if (rect.bottomAnchor.target)
		{
			++anchorCount;
			rect.bottomAnchor.absolute += iy;
		}

		if (rect.topAnchor.target)
		{
			++anchorCount;
			rect.topAnchor.absolute += iy;
		}

#if UNITY_EDITOR
		NGUITools.SetDirty(rect);
#endif

		// If all sides were anchored, we're done
		if (anchorCount != 0) rect.UpdateAnchors();
	}
Exemplo n.º 10
0
 public static void MoveRect(UIRect rect, float x, float y)
 {
     int num = Mathf.FloorToInt(x + 0.5f);
     int num2 = Mathf.FloorToInt(y + 0.5f);
     Transform cachedTransform = rect.cachedTransform;
     cachedTransform.localPosition += new Vector3((float)num, (float)num2);
     int num3 = 0;
     if (rect.leftAnchor.target)
     {
         num3++;
         rect.leftAnchor.absolute += num;
     }
     if (rect.rightAnchor.target)
     {
         num3++;
         rect.rightAnchor.absolute += num;
     }
     if (rect.bottomAnchor.target)
     {
         num3++;
         rect.bottomAnchor.absolute += num2;
     }
     if (rect.topAnchor.target)
     {
         num3++;
         rect.topAnchor.absolute += num2;
     }
     if (num3 != 0)
     {
         rect.UpdateAnchors();
     }
 }