public void Execute() { if (UnityEngine.Input.GetKeyDown(KeyCode.Escape)) { SceneSetup.LoadPreviousScene(); } }
void OnGUI() { GUILayout.Label("STEP Export", EditorStyles.boldLabel); GUILayout.Space(20f); // create the simulated right handed coordinate system and spawn the sample model GUILayout.Label("Setup right handed coordinate system:", EditorStyles.label); if (GUILayout.Button("Setup")) { if (GameObject.Find("simulated_right_handed_coordinate_system_Z_up") != null) { Debug.LogWarning("GameObject with name 'simulated_right_handed_coordinate_system_Z_up' already exists. Delete the GameObject first."); return; } sceneSetup = new SceneSetup(); stepExport = new StepExport(); rootCoordinateSystem = sceneSetup.Setup(); } GUILayout.Space(20f); // specify export path and provide option to export the scene content to file GUILayout.Label("Specify export path and write file:", EditorStyles.label); EditorGUI.BeginDisabledGroup(sceneSetup == null || rootCoordinateSystem == null); path = GUILayout.TextField(path); GUILayout.Space(4f); if (GUILayout.Button("Export STEP")) { stepExport.WriteSceneToStepFile(path, rootCoordinateSystem); } EditorGUI.EndDisabledGroup(); }
public static void LoadDataPackageInToEditor(LevelSceneData sceneData) { //Get the selected data if (sceneData) { int loadcount = sceneData.SceneList.Count; if (!String.IsNullOrEmpty(sceneData.MasterScene)) { loadcount++; } SceneSetup[] setup = new SceneSetup[loadcount]; int i = 0; if (loadcount > sceneData.SceneList.Count) { setup[0] = new SceneSetup(); setup[0].path = sceneData.MasterScene; setup[0].isLoaded = true; setup[0].isActive = true; i = 1; } foreach (SceneData sdata in sceneData.SceneList) { setup[i] = new SceneSetup(); setup[i].path = sdata.Path; setup[i].isLoaded = true; i++; } EditorSceneManager.RestoreSceneManagerSetup(setup); } }
public void Execute() { if (UnityEngine.Input.GetKeyDown(KeyCode.Escape)) { SceneSetup.LoadScene("MainMenu"); } }
public void Execute() { if (UnityEngine.Input.GetKeyDown(KeyCode.R)) { SceneSetup.LoadScene("Editor"); } }
/// <summary> /// Construct from a Unity SceneSetup /// </summary> public SceneEntry(SceneSetup sceneSetup) { scene = new AmsSceneReference(sceneSetup.path); loadInEditor = sceneSetup.isLoaded; loadMethod = LoadMethod.Additive; }
public void LoadSetupInclusive() { SceneSetup[] current = EditorSceneManager.GetSceneManagerSetup(); SceneSetup[] newSetup = new SceneSetup[current.Length + setup.Length]; int newSetupIndex = 0; for (int i = 0; i < current.Length; i++) { newSetup[newSetupIndex] = current[i]; newSetupIndex++; } for (int i = 0; i < setup.Length; i++) { newSetup[newSetupIndex] = new SceneSetup() { path = setup[i].path, isLoaded = setup[i].isLoaded, isActive = false }; newSetupIndex++; } EditorSceneManager.RestoreSceneManagerSetup(newSetup); }
public void Execute(List <Entity> entities) { if (entities.Any(x => x.hasActingSequences)) { return; } SceneSetup.LoadScene("Editor"); }
public SceneSetup ConvertToSceneSetup() { SceneSetup ss = new SceneSetup(); ss.isActive = isActive; ss.isLoaded = isLoaded; ss.path = path; return(ss); }
internal SceneSetup ToSceneSetup() { var ss = new SceneSetup(); ss.isActive = isActive; ss.isLoaded = isLoaded; ss.path = path; return(ss); }
public SceneSetup ToSceneSetup() { var sceneSetup = new SceneSetup(); sceneSetup.path = AssetDatabase.GUIDToAssetPath(guid); sceneSetup.isActive = isActive; sceneSetup.isLoaded = isLoaded; return(sceneSetup); }
static void LoadMaster() { SceneSetup[] sceneSetup = new SceneSetup[1]; sceneSetup[0] = new SceneSetup(); sceneSetup[0].path = GameMasterSettings.GAMEMASTER_SCENE; sceneSetup[0].isLoaded = true; sceneSetup[0].isActive = true; EditorSceneManager.RestoreSceneManagerSetup(sceneSetup); }
public SceneSetup[] ToSceneSetups() { var result = new SceneSetup[sceneSetups.Length]; for (int i = 0; i < sceneSetups.Length; i++) { result[i] = sceneSetups[i].ToSceneSetup(); } return(result); }
private static void CheckHeaderForExits(int f, int headeraddr, Scene scene) { int j = headeraddr; int setupsaddr = -1; int nextlowest = -1; byte s; var setup = new SceneSetup(); scene.Setups.Add(setup); while (true) { byte cmd = RomData.MMFileList[f].Data[j]; if (cmd == 0x13) { setup.ExitListAddress = (int)ReadWriteUtils.Arr_ReadU32(RomData.MMFileList[f].Data, j + 4) & 0xFFFFFF; } else if (cmd == 0x17) { setup.CutsceneListAddress = (int)ReadWriteUtils.Arr_ReadU32(RomData.MMFileList[f].Data, j + 4) & 0xFFFFFF; } else if (cmd == 0x18) { setupsaddr = (int)ReadWriteUtils.Arr_ReadU32(RomData.MMFileList[f].Data, j + 4) & 0xFFFFFF; } else if (cmd == 0x14) { break; } else { if (RomData.MMFileList[f].Data[j + 4] == 0x02) { int p = (int)ReadWriteUtils.Arr_ReadU32(RomData.MMFileList[f].Data, j + 4) & 0xFFFFFF; if (((p < nextlowest) || (nextlowest == -1)) && ((p > setupsaddr) && (setupsaddr != -1))) { nextlowest = p; } } } j += 8; } if ((setupsaddr != -1) && nextlowest != -1) { j = setupsaddr; s = RomData.MMFileList[f].Data[j]; while (s == 0x02) { int p = (int)ReadWriteUtils.Arr_ReadU32(RomData.MMFileList[f].Data, j) & 0xFFFFFF; CheckHeaderForExits(f, p, scene); j += 4; s = RomData.MMFileList[f].Data[j]; } } }
private static SceneSetup[] ConvertRuntimeToEditorSceneSetups(RuntimeSceneSetup[] RuntimeSceneSetups) { SceneSetup[] sceneSetups = new SceneSetup[RuntimeSceneSetups.Length]; for (int i = 0; i < RuntimeSceneSetups.Length; ++i) { sceneSetups[i] = RuntimeSceneSetups[i].ConvertToSceneSetup(); } return(sceneSetups); }
void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else if (Instance != this) { DestroyImmediate(gameObject); } }
public PlayerState(SceneSetup setup) { this.setup = setup; Equipment = new Dictionary <string, EquipmentState>(); Bag = new Dictionary <RewardType, int>(); foreach (var equipment in setup.Equipment) { Equipment[equipment.Identifier] = new EquipmentState() { Level = equipment.StartingLevel }; } }
public override void OnInspectorGUI() { DrawDefaultInspector(); // For non hidden inspector fields to be displayed SceneSetup sceneSetup = (SceneSetup)target; // Set reference to main SceneSetup script // Draw checkboxes for bools sceneSetup.overrideFarClip = EditorGUILayout.Toggle("Override Far Clip", sceneSetup.overrideFarClip); // Show overrride for far clip plane if (sceneSetup.overrideFarClip) { sceneSetup.farDistanceOverride = EditorGUILayout.IntSlider("Far Distance Override", sceneSetup.farDistanceOverride, 1, 2000); } }
static void AddMaster() { SceneSetup[] sceneSetupRaw = EditorSceneManager.GetSceneManagerSetup(); //Array.Resize(ref sceneSetup, sceneSetup.Length + 1); SceneSetup[] sceneSetup = new SceneSetup[sceneSetupRaw.Length + 1]; for (int i = 0; i < sceneSetupRaw.Length; i++) { sceneSetup[i + 1] = sceneSetupRaw[i]; } sceneSetup[0] = new SceneSetup(); sceneSetup[0].path = GameMasterSettings.GAMEMASTER_SCENE; sceneSetup[0].isLoaded = true; sceneSetup[0].isActive = false; EditorSceneManager.RestoreSceneManagerSetup(sceneSetup); }
public static void RestoreSetup(EditorSceneSetup editorSetup) { SceneSetup[] setups = new SceneSetup[editorSetup.LoadedScenes.Length]; for (int i = 0; i < setups.Length; i++) { setups[i] = new SceneSetup(); string path = AssetDatabase.GetAssetPath(editorSetup.LoadedScenes[i].Scene); setups[i].path = path; setups[i].isLoaded = editorSetup.LoadedScenes[i].Loaded; setups[i].isActive = (editorSetup.ActiveScene == i); } EditorSceneManager.RestoreSceneManagerSetup(setups); }
public static void RestoreState(SceneState state) { var scenes = new SceneSetup[state.Scenes.Length]; for (var i = 0; i < state.Scenes.Length; i++) { scenes[i] = new SceneSetup { isActive = state.Scenes[i].IsActive, isLoaded = state.Scenes[i].IsLoaded, path = state.Scenes[i].Path } } ; EditorSceneManager.RestoreSceneManagerSetup(scenes); } #endregion }
public void Execute(List <Entity> entities) { var hero = entities.SingleEntity(); var levelExits = _levelExitsGroup.GetEntities(); if (levelExits.Any(x => x.position.Value == hero.position.Value)) { try { // TODO: FIX SO THAT NEXT LEVEL IS LOADED! SceneSetup.LoadScene("Play"); } catch (Exception) { SceneManager.LoadScene("gameover"); } } }
void Start() { // PieceActionsDictionary = new Dictionary<string, PieceAction>();//LoadTextResource<PieceAction>(); // PieceEventsDictionary = new Dictionary<string, PieceEvent>();//LoadTextResource<PieceEvent>(); //PieceModelObjectsDictionary = LoadTextResource<PieceModelObject>(); //PieceModelTextPanelsDictionary = LoadTextResource<PieceModelTextPanel>(); //TrackedTagsDictionary = LoadTextResource<TrackedTag>(); //PieceModelTextPanelsDictionary.Values.ForEach(pm => pm.ModelType = "PieceModelTextPanel"); PieceActions = ResourcesMaster.JsonToList <PieceAction>("PieceActions"); string lcsp = ResourcesMaster.ListToJson <PieceAction>(PieceActions); foreach (PieceAction pa in PieceActions) { pa.FullyLoad(); //PieceActionsDictionary.Add(pa.Name, pa); } //ResourcesMaster.WriteUp("PieceActions", lcsp); SceneSetup = ResourcesMaster.JsonToObject <SceneSetup>("SceneSetup_Torno"); string sss = ResourcesMaster.ObjectToJson <SceneSetup>(SceneSetup); ResourcesMaster.WriteUp("SceneSetupBackup", sss); foreach (TrackedAnimationTag Tk in SceneSetup.TrackedAnimationTags) { foreach (PieceModel Panel in Tk.Panels) { Panel.FullyLoad(); } foreach (PieceModel Model in Tk.Models) { Model.FullyLoad(); } } // }
public static bool OnOpenMultiSceneSetup(int instanceID, int line) { Object openObject = EditorUtility.InstanceIDToObject(instanceID); if (!(openObject is MultiSceneSetup)) { return(false); } MultiSceneSetup multiSceneSetup = openObject as MultiSceneSetup; SceneSetup[] sceneSetup = new SceneSetup[multiSceneSetup.scenePaths.Length]; for (int i = 0; i < sceneSetup.Length; i++) { sceneSetup[i] = new SceneSetup(); sceneSetup[i].path = "Assets/" + multiSceneSetup.scenePaths[i]; sceneSetup[i].isActive = multiSceneSetup.indexActiveScene == i; sceneSetup[i].isLoaded = true; } EditorSceneManager.RestoreSceneManagerSetup(sceneSetup); return(true); }
public void Start() { SceneSetup.CurrentScene = "MainMenu"; SceneSetup.OnSceneChanging += OnSceneChanging; var canvas = GameObject.Find("Canvas"); _uiPool = Pools.ui; _systems = SceneSetup.CreateSystem().Add <ReloadSystem>() .Add(_uiPool.CreateSystem <AddOrRemoveViewSystem>()) .Add(_uiPool.CreateSystem <ConnectMenuItemToParentSystem>()) .Add(_uiPool.CreateSystem <CursorClickMenuItemSystem>()) .Add(_uiPool.CreateSystem <SelectedItemAnimationSystem>()) .Add(_uiPool.CreateSystem <DestroySystem>()); _uiPool.CreateMenuItems(canvas, new Tuple <string, Action>("New Game", () => SceneSetup.LoadScene("Play")), new Tuple <string, Action>("Editor", () => SceneSetup.LoadScene("Editor"))); _systems.Initialize(); }
public static void LoadEditorScenes(MultiSceneController.ScenePathList scenePathList) { var scenePaths = scenePathList.scenePaths; var scenes = new List <SceneSetup>(scenePaths.Length); for (int i = 0; i < scenePaths.Length; ++i) { if (string.IsNullOrEmpty(scenePaths[i])) { continue; } var scene = new SceneSetup(); scene.path = scenePaths[i]; scene.isActive = i == scenePathList.activeSceneIndex; scene.isLoaded = true; scenes.Add(scene); } Debug.LogFormat("Restoring {0} editor scenes.", scenes.Count); EditorSceneManager.RestoreSceneManagerSetup(scenes.ToArray()); }
static bool ValidateInstantiatePrefabs() { return(SceneSetup.DoPrefabsExist()); }
static void InstantiatePrefabs() { SceneSetup.SetupScene(); }
public void LoadScene() { SceneSetup.LoadScene("MainMenu"); }
void Start() { _sceneSetUp = GameObject.FindGameObjectWithTag("MainManager").GetComponent <SceneSetup>(); levelOverPanel.SetActive(false); }