コード例 #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
ファイル: TestView.cs プロジェクト: illyasviel/ServerControl
 private void AddCallback(ShareEntityProto obj)
 {
     if (obj == null)
         Debug.Log("添加失败");
     else
     {
         Debug.Log("添加成功: " + obj);
         // obj指向Comm.add的第一个参数
         // 添加操作会更改Comm.add第一个参数的主键值
         // 更改的主键值是由服务器决定的
     }
 }
コード例 #3
0
ファイル: TestView.cs プロジェクト: illyasviel/ServerControl
 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
ファイル: TestView.cs プロジェクト: illyasviel/ServerControl
 private void FindCallback(ShareEntityProto obj)
 {
     if (obj == null)
         Debug.Log("没有找到");
     else
         Debug.Log("找到: " + obj);
 }