ResetAnchors() public method

Ensure that all rect references are set correctly on the anchors.
public ResetAnchors ( ) : void
return void
Beispiel #1
0
    static int ResetAnchors(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        UIRect obj = (UIRect)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIRect");

        obj.ResetAnchors();
        return(0);
    }
Beispiel #2
0
    static int ResetAnchors(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        UIRect obj = LuaScriptMgr.GetNetObject <UIRect>(L, 1);

        obj.ResetAnchors();
        return(0);
    }
Beispiel #3
0
 static public int ResetAnchors(IntPtr l)
 {
     try {
         UIRect self = (UIRect)checkSelf(l);
         self.ResetAnchors();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static int ResetAnchors(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UIRect obj = (UIRect)ToLua.CheckObject <UIRect>(L, 1);
         obj.ResetAnchors();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    public static int ResetAnchors(IntPtr l)
    {
        int result;

        try
        {
            UIRect uIRect = (UIRect)LuaObject.checkSelf(l);
            uIRect.ResetAnchors();
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Beispiel #6
0
    void Start()
    {
        _uiItem = this.GetSafeComponent <UIRect>();

        //float w = Screen.width ;
        //float h = Screen.height;

        //float res = h/w;
        //Debug.LogWarning(res);

        _uiItem.leftAnchor.target = _uiItem.rightAnchor.target = transform.root.Find("Panel1");

        _uiItem.leftAnchor.Set(0f, 0f);
        _uiItem.rightAnchor.Set(1f, 0f);

        _uiItem.ResetAnchors();
    }
Beispiel #7
0
    private static int ResetAnchors(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 1);
            UIRect uIRect = (UIRect)ToLua.CheckObject(L, 1, typeof(UIRect));
            uIRect.ResetAnchors();
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
Beispiel #8
0
	void Start ()
	{
        _uiItem = this.GetSafeComponent<UIRect>();

        //float w = Screen.width ;
        //float h = Screen.height;

	    //float res = h/w;
        //Debug.LogWarning(res);

        _uiItem.leftAnchor.target = _uiItem.rightAnchor.target = transform.root.Find("Panel1");

	    _uiItem.leftAnchor.Set(0f, 0f);
	    _uiItem.rightAnchor.Set(1f, 0f);

        _uiItem.ResetAnchors();
	}
 public void RemoveAnchors(bool ignoreOnEnable, bool ignoreOnStart, bool ignoreUpdate)
 {
     foreach (Transform transform in this.GetHaveUIRectObjects <UIRect>(this._isRootThisObject, this._isIncludeRootObject, this._isIncludeThisObject))
     {
         UIRect component = transform.GetComponent <UIRect>();
         if (!ignoreOnEnable || component.updateAnchors != UIRect.AnchorUpdate.OnEnable)
         {
             if (!ignoreOnStart || component.updateAnchors != UIRect.AnchorUpdate.OnStart)
             {
                 if (!ignoreUpdate || component.updateAnchors != UIRect.AnchorUpdate.OnUpdate)
                 {
                     component.topAnchor.target    = null;
                     component.bottomAnchor.target = null;
                     component.leftAnchor.target   = null;
                     component.rightAnchor.target  = null;
                     component.ResetAnchors();
                 }
             }
         }
     }
 }