// 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();
     }
 }
 // Token: 0x06001523 RID: 5411 RVA: 0x00065908 File Offset: 0x00063B08
 private void Awake()
 {
     if (this.groundNodeGroup)
     {
         this.groundNodes = UnityEngine.Object.Instantiate <NodeGraph>(this.groundNodeGroup.nodeGraph);
     }
     if (this.airNodeGroup)
     {
         this.airNodes = UnityEngine.Object.Instantiate <NodeGraph>(this.airNodeGroup.nodeGraph);
     }
     if (this.railNodeGroup)
     {
         this.railNodes = UnityEngine.Object.Instantiate <NodeGraph>(this.railNodeGroup.nodeGraph);
     }
     this.sceneDef = SceneCatalog.GetSceneDefFromSceneName(base.gameObject.scene.name);
 }
 // 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();
     }
 }
Beispiel #4
0
 private static void Init()
 {
     SceneCatalog.indexToSceneDef     = Resources.LoadAll <SceneDef>("SceneDefs/");
     SceneManager.activeSceneChanged += delegate(Scene oldScene, Scene newScene)
     {
         SceneCatalog.currentSceneDef = SceneCatalog.GetSceneDefFromSceneName(newScene.name);
         if (SceneCatalog.currentSceneDef != null)
         {
             SceneCatalog.mostRecentSceneDef = SceneCatalog.currentSceneDef;
             Action <SceneDef> action = SceneCatalog.onMostRecentSceneDefChanged;
             if (action == null)
             {
                 return;
             }
             action(SceneCatalog.mostRecentSceneDef);
         }
     };
     SceneCatalog.currentSceneDef    = SceneCatalog.GetSceneDefFromSceneName(SceneManager.GetActiveScene().name);
     SceneCatalog.mostRecentSceneDef = SceneCatalog.currentSceneDef;
     SceneCatalog.availability.MakeAvailable();
 }
Beispiel #5
0
 // Token: 0x06001910 RID: 6416 RVA: 0x0006C164 File Offset: 0x0006A364
 private static void SetSceneDefs(SceneDef[] newSceneDefs)
 {
     SceneCatalog.indexToSceneDef = HGArrayUtilities.Clone <SceneDef>(newSceneDefs);
     for (int i = 0; i < SceneCatalog.indexToSceneDef.Length; i++)
     {
         SceneCatalog.indexToSceneDef[i].sceneDefIndex = i;
     }
     SceneManager.activeSceneChanged += delegate(Scene oldScene, Scene newScene)
     {
         SceneCatalog.currentSceneDef = SceneCatalog.GetSceneDefFromSceneName(newScene.name);
         if (SceneCatalog.currentSceneDef != null)
         {
             SceneCatalog.mostRecentSceneDef = SceneCatalog.currentSceneDef;
             Action <SceneDef> action = SceneCatalog.onMostRecentSceneDefChanged;
             if (action == null)
             {
                 return;
             }
             action(SceneCatalog.mostRecentSceneDef);
         }
     };
     SceneCatalog.currentSceneDef    = SceneCatalog.GetSceneDefFromSceneName(SceneManager.GetActiveScene().name);
     SceneCatalog.mostRecentSceneDef = SceneCatalog.currentSceneDef;
 }
        // Token: 0x06000644 RID: 1604 RVA: 0x00019E18 File Offset: 0x00018018
        private void SetUpSeerStations()
        {
            SceneDef        nextStageScene = Run.instance.nextStageScene;
            List <SceneDef> list           = new List <SceneDef>();

            if (nextStageScene != null)
            {
                int stageOrder = nextStageScene.stageOrder;
                foreach (SceneDef sceneDef in SceneCatalog.allSceneDefs)
                {
                    if (sceneDef.stageOrder == stageOrder)
                    {
                        list.Add(sceneDef);
                    }
                }
            }
            foreach (SeerStationController seerStationController in this.seerStations)
            {
                if (list.Count == 0)
                {
                    seerStationController.GetComponent <PurchaseInteraction>().SetAvailable(false);
                }
                else
                {
                    Util.ShuffleList <SceneDef>(list, this.rng);
                    int      index       = list.Count - 1;
                    SceneDef targetScene = list[index];
                    list.RemoveAt(index);
                    if (this.rng.nextNormalizedFloat < 0.05f)
                    {
                        targetScene = SceneCatalog.GetSceneDefFromSceneName("goldshores");
                    }
                    seerStationController.SetTargetScene(targetScene);
                }
            }
        }
 // Token: 0x060012DE RID: 4830 RVA: 0x000510A0 File Offset: 0x0004F2A0
 private void SetTargetSceneDefIndex(int newTargetSceneDefIndex)
 {
     this.NetworktargetSceneDefIndex = newTargetSceneDefIndex;
     this.OnTargetSceneChanged(SceneCatalog.GetSceneDef(this.targetSceneDefIndex));
 }
Beispiel #8
0
 public static SceneDef GetSceneDefForCurrentScene()
 {
     return(SceneCatalog.GetSceneDefFromScene(SceneManager.GetActiveScene()));
 }
Beispiel #9
0
 public static SceneDef GetSceneDefFromScene(Scene scene)
 {
     return(SceneCatalog.GetSceneDefFromSceneName(scene.name));
 }
Beispiel #10
0
 // Token: 0x060013AA RID: 5034 RVA: 0x0006008C File Offset: 0x0005E28C
 private void FindStageLogUnlockable()
 {
     this.unlockableName = SceneCatalog.GetUnlockableLogFromSceneName(SceneManager.GetActiveScene().name);
 }