Exemplo n.º 1
0
    /// <summary>
    /// 适配根结点
    /// </summary>
    /// <param name="uiPage"></param>
    private void adjustRoot(UIPage uiPage)
    {
        UIPageRoot pageRoot = UIPageRoot.Instance;
        //设置界面的根结点
        Transform     parentTrans = pageRoot.GetRoot(uiPage.AttributePage.pageType);
        RectTransform rectTrans   = uiPage.gameObject.GetComponent <RectTransform>();

        rectTrans.SetParent(parentTrans);
        rectTrans.anchoredPosition     = Vector2.zero;
        rectTrans.transform.localScale = Vector3.one;
    }
Exemplo n.º 2
0
    public UIPage(LuaPageBehaviour luaBehaviour, string pagePath)
    {
        pageRoot = UIPageRoot.Instance;
        context  = new PageContext();

        this.luaBehaviour = luaBehaviour;

        context.assetPath = pagePath;
        context.pageName  = Path.GetFileNameWithoutExtension(pagePath);

        cacheGameObj = luaBehaviour.gameObject;
        cacheTrans   = cacheGameObj.transform;
    }