예제 #1
0
 protected override void DecodePackage(NetReader reader)
 {
     if (reader.StatusCode == 0)
     {
         _obj = ProtoBufUtils.Deserialize<ShareEntityProto>(reader.Buffer);
     }
     else
     {
         UnityEngine.Debug.LogError(this.GetType() + ".DecodePackage(): reader.StatusCode = " + reader.StatusCode);
     }
 }
예제 #2
0
 private void AddCallback(ShareEntityProto obj)
 {
     if (obj == null)
         Debug.Log("添加失败");
     else
     {
         Debug.Log("添加成功: " + obj);
         // obj指向Comm.add的第一个参数
         // 添加操作会更改Comm.add第一个参数的主键值
         // 更改的主键值是由服务器决定的
     }
 }
예제 #3
0
 private void ReSyncCallback(ShareEntityProto obj)
 {
     if (obj.GetType() == typeof (UserCharacterInfo))
     {
         if (obj.Key != _myId)
             Debug.Log("<Enemy> : " + obj);
         else
             Debug.Log("<Myself> : " + obj);
     }
     else
         Debug.Log(obj);
 }
예제 #4
0
 private void FindCallback(ShareEntityProto obj)
 {
     if (obj == null)
         Debug.Log("没有找到");
     else
         Debug.Log("找到: " + obj);
 }