Example #1
0
 private void ClientOnObjectDestroyed(IGameObjectInfo objectInfo)
 {
     for (int i = 0; i < MapView.ChildContainer.transform.childCount; i++)
     {
         var child = MapView.ChildContainer.transform.GetChild(i);
         var view  = child.GetComponent <SelectableView>();
         if (view != null && view.InfoBase.ID == objectInfo.ID)
         {
             Destroy(child.gameObject);
             child.parent = null;
             break;
         }
     }
 }
Example #2
0
 public static ObjectState CreateObjectState(IGameObjectInfo info)
 {
     return(new ObjectState
     {
         ID = new ID {
             Value = info.ID.ToString()
         },
         PlayerID = new ID {
             Value = info.PlayerID.ToString()
         },
         Health = info.Health,
         MaxHealth = info.MaxHealth,
         Position = info.Position.ToGrpc(),
         ViewRadius = info.ViewRadius
     });
 }