// Token: 0x060012AA RID: 4778 RVA: 0x00050500 File Offset: 0x0004E700
        public void SetState(SceneExitController.ExitState newState)
        {
            if (newState == this.exitState)
            {
                return;
            }
            this.exitState = newState;
            switch (this.exitState)
            {
            case SceneExitController.ExitState.Idle:
                break;

            case SceneExitController.ExitState.ExtractExp:
                SceneExitController.isRunning = true;
                this.experienceCollector      = base.gameObject.AddComponent <ConvertPlayerMoneyToExperience>();
                return;

            case SceneExitController.ExitState.TeleportOut:
            {
                ReadOnlyCollection <CharacterMaster> readOnlyInstancesList = CharacterMaster.readOnlyInstancesList;
                for (int i = 0; i < readOnlyInstancesList.Count; i++)
                {
                    CharacterMaster component = readOnlyInstancesList[i].GetComponent <CharacterMaster>();
                    if (component.GetComponent <SetDontDestroyOnLoad>())
                    {
                        GameObject bodyObject = component.GetBodyObject();
                        if (bodyObject)
                        {
                            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/NetworkedObjects/TeleportOutController"), bodyObject.transform.position, Quaternion.identity);
                            gameObject.GetComponent <TeleportOutController>().Networktarget = bodyObject;
                            NetworkServer.Spawn(gameObject);
                        }
                    }
                }
                this.teleportOutTimer = 4f;
                return;
            }

            case SceneExitController.ExitState.Finished:
                if (Run.instance && Run.instance.isGameOverServer)
                {
                    return;
                }
                if (this.useRunNextStageScene)
                {
                    Stage.instance.BeginAdvanceStage(Run.instance.nextStageScene);
                    return;
                }
                if (this.destinationScene)
                {
                    Stage.instance.BeginAdvanceStage(this.destinationScene);
                    return;
                }
                Debug.Log("SceneExitController: destinationScene not set!");
                break;

            default:
                return;
            }
        }
        private void SceneExitController_SetState(On.RoR2.SceneExitController.orig_SetState orig, SceneExitController self, SceneExitController.ExitState newState)
        {
            orig(self, newState);

            if (newState == SceneExitController.ExitState.TeleportOut)
            {
                IsAdvancingStage = true;
            }
        }
Пример #3
0
        private void SceneExitController_SetState(On.RoR2.SceneExitController.orig_SetState orig, SceneExitController self, SceneExitController.ExitState newState)
        {
            bool approved = newState != self.exitState;

            orig(self, newState);
            if (!approved)
            {
                return;
            }
            switch (self.exitState)
            {
            case SceneExitController.ExitState.Idle:
                preventMoneyDrops = false;
                break;

            case SceneExitController.ExitState.ExtractExp:
                if (preventModUseOnStageEnd)
                {
                    preventMoneyDrops = true;
                }
                if (refundOnStageEnd)
                {
                    RefundMoneyPackPickups();
                }
                break;

            default:
                if (preventModUseOnStageEnd)
                {
                    preventMoneyDrops = true;
                }
                break;
            }
        }