示例#1
0
 protected virtual void OnDestroy()
 {
     if (this.netObjectID.HasValue)
     {
         NetObject.netObjectFromId.Remove(this.netObjectID.Value);
         GNetworkManager.RecycleNetObjectID(this.netObjectID.Value);
     }
 }
示例#2
0
 public static void AssignNetObjectID(int id)
 {
     if (GNetworkManager.idRequests.Count > 0)
     {
         IdRequestHandler idRequest = GNetworkManager.idRequests.Dequeue();
         if (idRequest.Target != null)
         {
             idRequest(id);
         }
         else
         {
             GNetworkManager.RecycleNetObjectID(id);
         }
     }
 }
示例#3
0
 protected virtual void Awake()
 {
     GNetworkManager.RequireNetObjectID(this.SetID);
 }