コード例 #1
0
 static void Postfix(CommuterChainController __result, StationController sourceStation)
 {
     if (NetworkManager.IsHost())
     {
         NetworkJobsSync jobSync = sourceStation.GetComponent <NetworkJobsSync>();
         if (jobSync != null)
         {
             jobSync.OnSingleChainGeneratedWithExistingCars(__result);
         }
     }
 }
コード例 #2
0
    public void OnFinishLoading()
    {
        if (NetworkManager.IsHost())
        {
            SendCurrentJobs();

            foreach (StationController station in StationController.allStations)
            {
                NetworkJobsSync jobSync = station.gameObject.AddComponent <NetworkJobsSync>();
                jobSync.OnJobsGenerated += SendJobCreatedMessage;
            }
            IsSynced = true;
        }
    }
コード例 #3
0
 static void Postfix(CommuterChainController __result, PassengerJobGenerator __instance, TrainCarsPerLogicTrack consistInfo = null)
 {
     if (NetworkManager.IsHost())
     {
         if (__instance.Controller && __instance.Controller.GetComponent <NetworkJobsSync>())
         {
             NetworkJobsSync jobSync = __instance.Controller.GetComponent <NetworkJobsSync>();
             if (consistInfo != null)
             {
                 jobSync.OnSingleChainGeneratedWithExistingCars(__result);
             }
             else
             {
                 jobSync.OnSingleChainGenerated(__result);
             }
         }
     }
 }