예제 #1
0
    public virtual void UpdateSlot(byte index, byte lv)
    {
        var slot = user.Slots.Find(x => x.SlotIndex == index);

        user.SP    -= ServerDefine.SlotLv2Price(slot.SlotLv);
        slot.SlotLv = lv;

        cubes.Where(x => x.gameCube.CubeId == slot.CubeId).ToList().ForEach(x => x.Lvup());
    }
예제 #2
0
        public override void Upsert(int index, GameSlot data)
        {
            base.Upsert(index, data);

            var cubeData = XmlKey.CubeData.Find <CubeDataXml.Data>(x => x.CubeId == data.CubeId);
            var price    = ServerDefine.SlotLv2Price(data.SlotLv);

            cube_image.color = new Color(cubeData.Color[0], cubeData.Color[1], cubeData.Color[2]);
            lv_text.SetText(data.SlotLv.ToString());
            sp_text.SetText(price.ToString());
        }
예제 #3
0
        public void Upsert(GameUser data)
        {
            base.Empty();

            if (data == null)
            {
                return;
            }

            base.Upsert();

            data.Slots.ForEach((x, i) =>
            {
                slotComponents[i].Upsert(i, x);
                slotComponents[i].Lock(data.SP < ServerDefine.SlotLv2Price(x.SlotLv));
            });
        }