Beispiel #1
0
    public unsafe override void ToBufferData(DataBuffer db, huqiang.Core.UIData.UIElementData *data)
    {
        FakeStruct fs = new FakeStruct(db, 3);

        fs[0] = (int)EventColliderType.Circle;
        fs.SetFloat(1, Radius);
        fs.SetFloat(2, Ratio);
        int type  = db.AddData("CircleEventHelper");
        int index = db.AddData(fs);

        data->eve = type << 16 | index;
    }
Beispiel #2
0
    public unsafe override void ToBufferData(DataBuffer db, huqiang.Core.UIData.UIElementData *data)
    {
        FakeStruct fake = new FakeStruct(db, 5);

        fake[0] = (int)direction;
        fake.SetFloat(1, spacing);
        fake[2] = FixedSize?1:0;
        fake.SetFloat(3, FixedSizeRatio);
        fake.SetFloat(4, ItemOffset);
        int type  = db.AddData("StackPanelHelper");
        int index = db.AddData(fake);

        data->composite = type << 16 | index;
    }
Beispiel #3
0
    public unsafe override void ToBufferData(DataBuffer db, huqiang.Core.UIData.UIElementData *data)
    {
        FakeStruct  fake = new FakeStruct(db, SliderInfo.ElementSize);
        SliderInfo *si   = (SliderInfo *)fake.ip;

        si->StartOffset = StartOffset;
        si->EndOffset   = EndOffset;
        si->MinScale    = MinScale;
        si->MaxScale    = MaxScale;
        si->direction   = direction;
        int type  = db.AddData("SliderHelper");
        int index = db.AddData(fake);

        data->composite = type << 16 | index;
    }
Beispiel #4
0
 public unsafe override void ToBufferData(DataBuffer db, huqiang.Core.UIData.UIElementData *data)
 {
     if (Points != null)
     {
         FakeStruct fs = new FakeStruct(db, 2);
         fs[0] = (int)EventColliderType.Polygon;
         if (Points != null)
         {
             if (Points.Length > 2)
             {
                 fs[1] = db.AddArray <Vector2>(Points);
             }
         }
         int type  = db.AddData("PolygonEventHelper");
         int index = db.AddData(fs);
         data->eve = type << 16 | index;
     }
 }
Beispiel #5
0
    public unsafe override void ToBufferData(DataBuffer db, huqiang.Core.UIData.UIElementData *data)
    {
        FakeStruct     fake = new FakeStruct(db, TextInputData.ElementSize);
        TextInputData *sp   = (TextInputData *)fake.ip;

        sp->inputColor     = inputColor;
        sp->tipColor       = tipColor;
        sp->pointColor     = pointColor;
        sp->selectColor    = selectColor;
        sp->inputString    = db.AddData(InputString);
        sp->tipString      = db.AddData(TipString);
        sp->CharacterLimit = CharacterLimit;
        sp->ReadyOnly      = ReadyOnly;
        sp->contentType    = contentType;
        sp->lineType       = lineType;
        data->eve          = db.AddData(fake);
        int type  = db.AddData("TextInputHelper");
        int index = db.AddData(fake);

        data->eve = type << 16 | index;
    }
Beispiel #6
0
    public unsafe override void ToBufferData(DataBuffer db, huqiang.Core.UIData.UIElementData *data)
    {
        FakeStruct  fake = new FakeStruct(db, ScrollInfo.ElementSize);
        ScrollInfo *info = (ScrollInfo *)fake.ip;

        info->minBox     = minBox;
        info->scrollType = scrollType;
        if (Slider != null)
        {
            var ui = Slider.GetComponent <UIContext>();
            if (ui != null)
            {
                info->Slider = ui.GetUIData().GetInstanceID();
            }
        }
        else
        {
            info->Slider = 0;
        }
        int type  = db.AddData("ScrollHelper");
        int index = db.AddData(fake);

        data->composite = type << 16 | index;
    }
Beispiel #7
0
 /// <summary>
 /// 将数据存储到FakeStrcut中
 /// </summary>
 /// <param name="data">数据缓存</param>
 /// <returns>FakeStruct数据</returns>
 public unsafe virtual void ToBufferData(DataBuffer db, huqiang.Core.UIData.UIElementData *data)
 {
 }