Esempio n. 1
0
    static int IntToEnum(IntPtr L)
    {
        int arg0 = (int)LuaDLL.lua_tonumber(L, 1);

        UIGrid.Arrangement o = (UIGrid.Arrangement)arg0;
        ToLua.Push(L, o);
        return(1);
    }
Esempio n. 2
0
 public override void Unity_Deserialize(int depth)
 {
     this.arrangement     = (UIGrid.Arrangement)SerializedStateReader.Instance.ReadInt32();
     this.sorting         = (UIGrid.Sorting)SerializedStateReader.Instance.ReadInt32();
     this.pivot           = (UIWidget.Pivot)SerializedStateReader.Instance.ReadInt32();
     this.maxPerLine      = SerializedStateReader.Instance.ReadInt32();
     this.cellWidth       = SerializedStateReader.Instance.ReadSingle();
     this.cellHeight      = SerializedStateReader.Instance.ReadSingle();
     this.animateSmoothly = SerializedStateReader.Instance.ReadBoolean();
     SerializedStateReader.Instance.Align();
     this.hideInactive = SerializedStateReader.Instance.ReadBoolean();
     SerializedStateReader.Instance.Align();
     this.keepWithinPanel = SerializedStateReader.Instance.ReadBoolean();
     SerializedStateReader.Instance.Align();
     this.sorted = SerializedStateReader.Instance.ReadBoolean();
     SerializedStateReader.Instance.Align();
 }
Esempio n. 3
0
    static int set_arrangement(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIGrid             obj  = (UIGrid)o;
            UIGrid.Arrangement arg0 = (UIGrid.Arrangement)ToLua.CheckObject(L, 2, typeof(UIGrid.Arrangement));
            obj.arrangement = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index arrangement on a nil value" : e.Message));
        }
    }
Esempio n. 4
0
    static int get_arrangement(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIGrid             obj = (UIGrid)o;
            UIGrid.Arrangement ret = obj.arrangement;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index arrangement on a nil value" : e.Message));
        }
    }
        protected override JSONObject ToJSON(WXHierarchyContext context)
        {
            JSONObject json = new JSONObject(JSONObject.Type.OBJECT);

            json.AddField("type", "UIGrid");

            JSONObject subJSON = new JSONObject(JSONObject.Type.OBJECT);

            //var a = JsonUtility.ToJson(uiGrid, true);
            //Debug.Log("========================");
            //Debug.Log(a);
            //Debug.Log("------------");
            //Debug.Log(uiGrid.pivot);

            UIGrid.Arrangement arrangement = uiGrid.arrangement;
            subJSON.AddField("arrangement", (int)arrangement);

            float cellWidth = uiGrid.cellWidth;

            subJSON.AddField("cellWidth", (float)cellWidth);

            float cellHeight = uiGrid.cellHeight;

            subJSON.AddField("cellHeight", (float)cellHeight);

            int columns = uiGrid.maxPerLine;             // 命名兼容UITable,每行|列最多个数,0为自动

            subJSON.AddField("columns", (int)columns);

            int paddingX = 0;             // 命名兼容UITable

            subJSON.AddField("paddingX", (int)paddingX);

            int paddingY = 0;             // 命名兼容UITable

            subJSON.AddField("paddingY", (int)paddingY);

            bool autoSize = false;             // Grid指定大小,不需要自动撑大,此处为兼容UITable

            subJSON.AddField("autoSize", autoSize);


            json.AddField("data", subJSON);

            return(json);
        }
Esempio n. 6
0
    private static int set_arrangement(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIGrid             uIGrid      = (UIGrid)obj;
            UIGrid.Arrangement arrangement = (UIGrid.Arrangement)((int)ToLua.CheckObject(L, 2, typeof(UIGrid.Arrangement)));
            uIGrid.arrangement = arrangement;
            result             = 0;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index arrangement on a nil value");
        }
        return(result);
    }
Esempio n. 7
0
    private static int get_arrangement(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIGrid             uIGrid      = (UIGrid)obj;
            UIGrid.Arrangement arrangement = uIGrid.arrangement;
            ToLua.Push(L, arrangement);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index arrangement on a nil value");
        }
        return(result);
    }
Esempio n. 8
0
    public EquidistancePageRecycle(UIScrollView sv, int dataCount, int size, int pageColum,
                                   OnLoadItem loadItem, OnUpdateItem updateItem, UIGrid.Arrangement arrangement = UIGrid.Arrangement.Horizontal,
                                   bool isNeedFirstLastLimit = true, int extraShownum = 1, int minDragCanMoveDistance = 0, bool isNeedFirstLastLimitRecycle = true)
    {
        mScrollView     = sv;
        DataCount       = dataCount;
        cellSize        = size;
        halfCellSize    = (float)cellSize / 2;
        pageColumnLimit = pageColum;
        extraShowNum    = extraShownum;

        onLoadItem      = loadItem;
        onUpdateItem    = updateItem;
        DataArrangeType = arrangement;

        minDragMoveDistance         = minDragCanMoveDistance;
        IsNeedFirstLastLimit        = isNeedFirstLastLimit;
        IsNeedFirstLastLimitRecycle = isNeedFirstLastLimitRecycle;

        InitNeed();
    }
Esempio n. 9
0
    public unsafe override void Unity_NamedDeserialize(int depth)
    {
        ISerializedNamedStateReader arg_1A_0 = SerializedNamedStateReader.Instance;

        byte[] var_0_cp_0 = $FieldNamesStorage.$RuntimeNames;
        int    var_0_cp_1 = 0;

        this.arrangement     = (UIGrid.Arrangement)arg_1A_0.ReadInt32(&var_0_cp_0[var_0_cp_1] + 928);
        this.sorting         = (UIGrid.Sorting)SerializedNamedStateReader.Instance.ReadInt32(&var_0_cp_0[var_0_cp_1] + 940);
        this.pivot           = (UIWidget.Pivot)SerializedNamedStateReader.Instance.ReadInt32(&var_0_cp_0[var_0_cp_1] + 697);
        this.maxPerLine      = SerializedNamedStateReader.Instance.ReadInt32(&var_0_cp_0[var_0_cp_1] + 948);
        this.cellWidth       = SerializedNamedStateReader.Instance.ReadSingle(&var_0_cp_0[var_0_cp_1] + 959);
        this.cellHeight      = SerializedNamedStateReader.Instance.ReadSingle(&var_0_cp_0[var_0_cp_1] + 969);
        this.animateSmoothly = SerializedNamedStateReader.Instance.ReadBoolean(&var_0_cp_0[var_0_cp_1] + 980);
        SerializedNamedStateReader.Instance.Align();
        this.hideInactive = SerializedNamedStateReader.Instance.ReadBoolean(&var_0_cp_0[var_0_cp_1] + 996);
        SerializedNamedStateReader.Instance.Align();
        this.keepWithinPanel = SerializedNamedStateReader.Instance.ReadBoolean(&var_0_cp_0[var_0_cp_1] + 1009);
        SerializedNamedStateReader.Instance.Align();
        this.sorted = SerializedNamedStateReader.Instance.ReadBoolean(&var_0_cp_0[var_0_cp_1] + 1025);
        SerializedNamedStateReader.Instance.Align();
    }