public void InitAtbFromMsg(NotifyAtb msg) { for (int i = 0; i < msg.atbTypes.Count; ++i) { int atbInt = msg.atbTypes[i]; AtbType atbType = (AtbType)atbInt; SetAtb(atbType, msg.atbValues[i]); } }
void InitAtb() { NotifyAtb msg = null; if (AtbInitData.TryGetValue(gid, out msg)) { InitAtbFromMsg(msg); AtbInitData.Remove(gid); } }
static void AtbNotify(byte[] data) { Scene scn = SceneSystem.Instance.mCurrentScene; if (scn == null) { return; } NotifyAtb msg = ProtoBufUtils.Deserialize <NotifyAtb>(data); Character cha = scn.GetCharacter(msg.uid); if (cha == null) { Character.AtbInitData[msg.uid] = msg; return; } cha.InitAtbFromMsg(msg); }
public void PacketToMsg() { if (mAtbMsgAround == null) { mAtbMsgAround = new NotifyAtb(); mAtbMsgAround.uid = mCharacter.gid; } if (mAtbMsgSelf == null) { mAtbMsgSelf = new NotifyAtb(); mAtbMsgSelf.uid = mCharacter.gid; } foreach (var kv in atbNodes) { AtbNode node = kv.Value; if (node == null) { return; } node.PacketToMsg(); } }