Esempio n. 1
0
 /// <summary>
 /// Changes the scene, overriding the prop shown on the loading screen (see <see cref="WorldUtils.ChangeScene(string, string, Vector3, Vector3, bool)"/>)
 /// </summary>
 public static void ChangeScene(string scene, string spawnPoint, Vector3 position, Vector3 rotation, bool skipLoading, string objectOverride)
 {
     //MetaState.Instance.LoadingScreenPropOverride = objectOverride;
     if (!string.IsNullOrEmpty(objectOverride))
     {
         MetaState.Instance.Intents.Add(new LoadingScreenPropIntent(objectOverride));
     }
     WorldUtils.ChangeScene(scene, spawnPoint, position, rotation, skipLoading);
 }
Esempio n. 2
0
        public void ChangeScene()
        {
            string spawnPointHack = SpawnPoint;

            if (UsePosition)
            {
                spawnPointHack = null;
            }
            else if (string.IsNullOrEmpty(SpawnPoint))
            {
                spawnPointHack = string.Empty;
            }

            WorldUtils.ChangeScene(NextScene, spawnPointHack, SpawnPosition, SpawnRotation);
        }
Esempio n. 3
0
 /// <summary>
 /// Changes the scene, overriding the prop shown on the loading screen (see <see cref="WorldUtils.ChangeScene(string, string, Vector3, Vector3, bool)"/>)
 /// </summary>
 public static void ChangeScene(string scene, string spawnPoint, Vector3 position, Vector3 rotation, bool skipLoading, string objectOverride)
 {
     //MetaState.Instance.LoadingScreenPropOverride = objectOverride;
     WorldUtils.ChangeScene(scene, spawnPoint, position, rotation, skipLoading);
 }
Esempio n. 4
0
        private void GotoNext(string next)
        {
            var nextLoc = ParseLocation(next);

            if (nextLoc.Value == "default")
            {
                PresentNewFrame(CurrentScene.Default);
            }
            else if (string.IsNullOrEmpty(nextLoc.Key) || nextLoc.Key == "this" || nextLoc.Key == CurrentSceneName)
            {
                PresentNewFrame(nextLoc.Value);
            }
            else if (nextLoc.Key == "meta")
            {
                //probably the only one carried over from Garlic Gang or Katana
                if (nextLoc.Value == "return")
                {
                    CloseDialogue();
                }
            }
            else if (nextLoc.Key == "shop")
            {
                var container = GameState.Instance.ContainerState[nextLoc.Value];
                ContainerModal.PushModal(GameState.Instance.PlayerRpgState.Inventory, container, true, null);
                CloseDialogue();
            }
            else if (nextLoc.Key == "scene")
            {
                CloseDialogue();

                var sceneController = BaseSceneController.Current;

                if (sceneController != null)
                {
                    //extract additional data if possible
                    string spawnPoint = string.Empty;
                    var    arr        = next.Split('.');
                    if (arr.Length >= 3)
                    {
                        spawnPoint = arr[2];
                    }

                    //clean exit
                    WorldUtils.ChangeScene(nextLoc.Value, spawnPoint, Vector3.zero, Vector3.zero);
                }
                else
                {
                    Debug.LogWarning("DialogueController forced scene exit!");
                    SceneManager.LoadScene(nextLoc.Value); //BAD BAD BAD forced exit
                }
            }
            else if (nextLoc.Key == "script")
            {
                CloseDialogue();

                Scripting.ScriptingModule.Call(nextLoc.Value, new Scripting.ScriptExecutionContext()
                {
                    Caller = this
                }, null);
            }
            else
            {
                LoadScene(nextLoc.Key); //this loads a dialogue scene, not a Unity scene (it's confusing right?)
                PresentNewFrame(nextLoc.Value);
            }
        }