Unity UGUI高级转轮视图组件:Fancy Carousel View设计与实战
2026/7/27 8:46:51
Bitmap 仅支持单 bit 读写;Bitfield 可一次性操作多 bit、多精度整数(u8/u16/i8/i32 等无符号 / 有符号整数),批量位运算,一条命令完成多组读写、增减,大幅减少网络 IO。
适用场景:
BITFIELD key [GET type offset] [SET type offset value] [INCRBY type offset increment] [OVERFLOW wrap/sat/fail]从偏移 0 读取 u8,偏移 8 读取 i16
bitfield user_stat get u8 0 get i16 8# 0号8位无符号设为1,8号16位有符号设为100 bitfield user_stat set u8 0 1 set i16 8 100用户在线时长紧凑计数器,溢出饱和不超上限
bitfield user_stat overflow sat incrby u8 0 1# 写入两个8位无符号整数 bitfield test set u8 0 10 set u8 8 20 # 自增第一个数值,溢出饱和 bitfield test overflow sat incrby u8 0 5 # 读取结果 bitfield test get u8 0 get u8 8