Example #1
0
 static void ApplyRigidBodyState(WhenOnClient when)
 {
     VehicleManager.Instance.whenToDisableRigidBody = when;
     foreach (var v in Vehicle.AllVehicles)
     {
         v.GetComponent <VehicleController>().EnableOrDisableRigidBody();
     }
 }
 public static bool Matches(this WhenOnClient when, bool isLocalPlayer, bool isClient)
 {
     if (when == WhenOnClient.Always)
     {
         return(true);
     }
     if (when == WhenOnClient.Never)
     {
         return(false);
     }
     if (isLocalPlayer && when == WhenOnClient.OnlyOnLocalPlayer)
     {
         return(true);
     }
     if (isClient && when == WhenOnClient.OnlyOnOtherClients)
     {
         return(true);
     }
     return(false);
 }