// Token: 0x060013C9 RID: 5065 RVA: 0x00054926 File Offset: 0x00052B26
 private void Start()
 {
     this.sceneDef = SceneCatalog.GetSceneDefForCurrentScene();
     if (NetworkServer.active)
     {
         this.NetworkstartRunTime = Run.instance.fixedTime;
         this.RespawnAllNPCs();
         this.BeginServer();
     }
     if (NetworkClient.active)
     {
         this.RespawnLocalPlayers();
     }
 }
Esempio n. 2
0
 // Token: 0x060015D5 RID: 5589 RVA: 0x0006897C File Offset: 0x00066B7C
 private void Start()
 {
     this.sceneDef = SceneCatalog.GetSceneDefForCurrentScene();
     if (NetworkServer.active)
     {
         this.NetworkstartRunTime = Run.instance.fixedTime;
         this.stageSpawnPosition  = this.SampleNodeGraphForSpawnPosition();
         ReadOnlyCollection <CharacterMaster> readOnlyInstancesList = CharacterMaster.readOnlyInstancesList;
         Transform playerSpawnTransform = this.GetPlayerSpawnTransform();
         for (int i = 0; i < readOnlyInstancesList.Count; i++)
         {
             CharacterMaster characterMaster = readOnlyInstancesList[i];
             if (characterMaster && !characterMaster.GetComponent <PlayerCharacterMasterController>() && !characterMaster.GetBodyObject() && characterMaster.gameObject.scene.buildIndex == -1)
             {
                 Vector3    vector   = Vector3.zero;
                 Quaternion rotation = Quaternion.identity;
                 if (playerSpawnTransform)
                 {
                     vector   = playerSpawnTransform.position;
                     rotation = playerSpawnTransform.rotation;
                     BaseAI        component  = readOnlyInstancesList[i].GetComponent <BaseAI>();
                     CharacterBody component2 = readOnlyInstancesList[i].bodyPrefab.GetComponent <CharacterBody>();
                     if (component && component2)
                     {
                         NodeGraph nodeGraph = component.GetNodeGraph();
                         if (nodeGraph)
                         {
                             List <NodeGraph.NodeIndex> list = nodeGraph.FindNodesInRange(vector, 10f, 100f, (HullMask)(1 << (int)component2.hullClassification));
                             if ((float)list.Count > 0f)
                             {
                                 nodeGraph.GetNodePosition(list[UnityEngine.Random.Range(0, list.Count)], out vector);
                             }
                         }
                     }
                 }
                 readOnlyInstancesList[i].Respawn(vector, rotation);
             }
         }
         this.BeginServer();
     }
     if (NetworkClient.active)
     {
         this.RespawnLocalPlayers();
     }
 }