Ejemplo n.º 1
0
    /// <summary>
    /// 创建UI界面
    /// </summary>
    public virtual void Create()
    {
        this.InitRegisterHandler();
        if (UICreateType.Res == uiCreateType)
        {
            if (null != this.Panel)
            {
                GameObject.Destroy(Panel);
            }
            this.Panel = CommonHelper.InstantiateGoByID(ResId, GUIHelper.GetUIRootObj());
        }
        else if (UICreateType.Go == uiCreateType)
        {
            this.Panel.SetActive(true);
        }

        //UI参与排序
        if (sortEnable)
        {
            sorterTag = this.Panel.AddSingleComponent <SorterTag>();
            uiCanvas  = this.Panel.AddSingleComponent <Canvas>();
            this.Panel.AddSingleComponent <GraphicRaycaster>();
            uiCanvas.overrideSorting = true;
            this.Panel.AddSingleComponent <ParticleOrderAutoSorter>();

            CommonHelper.GetUIMgr().GetUISorterMgr().AddPanel(this);
        }

        AttachListener(Panel);
        this.OnCreate();
        this.OnShow(IsShow);
    }
Ejemplo n.º 2
0
 static int GetSorter(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         SorterTag obj = (SorterTag)ToLua.CheckObject <SorterTag>(L, 1);
         int       o   = obj.GetSorter();
         LuaDLL.lua_pushinteger(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 3
0
 static int SetSpace3D(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         SorterTag obj  = (SorterTag)ToLua.CheckObject <SorterTag>(L, 1);
         int       arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         obj.SetSpace3D(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 4
0
    static int get_Space3D(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            SorterTag obj = (SorterTag)o;
            int       ret = obj.Space3D;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Space3D on a nil value"));
        }
    }
Ejemplo n.º 5
0
    static int set_Space3D(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            SorterTag obj  = (SorterTag)o;
            int       arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.Space3D = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Space3D on a nil value"));
        }
    }