public SceneInfo GetSheetInfo(Int64 id) { var result = default(SceneInfo); SceneInfos.TryGetValue(id, out result); return(result); }
public SceneInfo RegisterSceneInfo(Int64 id, string name) { var result = default(SceneInfo); if (id != 0 && SceneInfos.ContainsKey(id)) { result = SceneInfos [id]; if (!string.IsNullOrEmpty(name)) { result.Name = name; } } else { if (id == 0) { id = Isaac.Long; } result = new SceneInfo { Id = id, Name = name }; result.State.Hollow = true; SceneInfos [id] = result; SceneInfoRegistered?.Invoke(result); } return(result); }
public SceneInfo CreateScene() { var si = new SceneInfo(this, FreeDefaultSceneName); SceneInfos.Add(si); return(si); }
public TaskInfo(ProjectInfo proj, XmlElement root) { ParentProjectInfo = proj; Name = root.GetAttribute("Name"); foreach (XmlElement node in root.GetElementsByTagName("Scene")) { SceneInfos.Add(new SceneInfo(this, node)); } }
public void Clear() { SelectedSceneInfo = null; foreach (SceneInfo si in SceneInfos) { si.Clear(); } SceneInfos.Clear(); }
protected void MakeTitle() { Info_Scene title = new Info_Scene(); title.Kind = 1; //title.File = "$$WHITE$$"; title.Queue = currentQueue; title.Group = currentGroup; SceneInfos.Add(title); IncrementGroup(); }
public bool RemoveScene(SceneInfo si) { if (SceneInfos.Contains(si)) { if (SceneInfos.Remove(si)) { OperationHistory.Instance.IsDirty = true; return(true); } } return(false); }
public bool BringSceneDelay(SceneInfo si) { int index = SceneInfos.IndexOf(si); if (index < 0 || index == SceneInfos.Count - 1) { return(false); } SceneInfos.Remove(si); SceneInfos.Insert(index + 1, si); OperationHistory.Instance.IsDirty = true; return(true); }
private void EnableScene(SceneInfos sceneInfos) { Scene sceneToLoad = SceneManager.GetSceneByName(sceneInfos.Name); if (sceneToLoad.IsValid()) { SceneManager.MoveGameObjectToScene(Hero.Instance.gameObject, sceneToLoad); SceneManager.SetActiveScene(sceneToLoad); _spawnManager.InitActiveSceneSpawns(); CurrentScene = sceneInfos; SwitchAudio(sceneToLoad.buildIndex); sceneInfos.Loaded = true; } }
public bool BringSceneEarly(SceneInfo si) { int index = SceneInfos.IndexOf(si); if (index <= 0) { return(false); } var si1 = SceneInfos[index - 1]; SceneInfos.Remove(si1); SceneInfos.Insert(index, si1); OperationHistory.Instance.IsDirty = true; return(true); }
public void AddScenes(List <Info_Scene> list, int startLevel, bool active) { foreach (var item in list) { if (item.Kind == 0) { item.Z = (startLevel++).ToString(); } item.Group = StoryBase.currentGroup; item.Queue = StoryBase.currentQueue; item.Active = active; if (!SceneInfos.Contains(item)) { SceneInfos.Add(item); } } }
protected void AddText(string story, Teller who, bool slow, bool active, int?fontSize = null) { string tran = "W..500>O.B.400.100"; string fs = null; if (fontSize.HasValue) { fs = $"{fontSize.Value}"; } if (who == Teller.Female) { if (slow) { tran = "W..1500>O.B.400.100"; } SceneInfos.Add(new Info_Scene(1) { Active = active, Story = story, Description = story, Group = currentGroup, Queue = currentQueue, S = fs, T = tran, O = "0", R = "2" }); } else if (who == Teller.Male) { SceneInfos.Add(new Info_Scene(1) { Active = active, Story = $"{story}", Description = story, Group = currentGroup, Queue = currentQueue, S = fs, T = tran, O = "0", R = "2" }); } else if (who == Teller.MaleThoughts) { SceneInfos.Add(new Info_Scene(1) { Active = active, Story = $"[{story}]", Description = story, Group = currentGroup, Queue = currentQueue, S = fs, T = tran, O = "0", R = "3" }); } else if (who == Teller.Author) { SceneInfos.Add(new Info_Scene(1) { Active = active, Story = $"[{story}]", Description = story, Group = currentGroup, Queue = currentQueue, S = fs, T = tran, O = "0", R = "3" }); } }
/// <summary> /// Gets the current scene infos for the build. If BuildCurrentScene is checked, all open scenes are returned. /// </summary> /// <returns>The array of SceneInfos.</returns> public SceneInfo[] GetSceneInfosForBuild() { if (BuildCurrentScene) { // Build a list of the root scenes var rootScenes = new List <SceneInfo>(); for (int i = 0; i != EditorSceneManager.sceneCount; i++) { var scene = EditorSceneManager.GetSceneAt(i); if (scene.isSubScene) { continue; } if (!scene.isLoaded) { continue; } if (EditorSceneManager.IsPreviewScene(scene)) { continue; } if (string.IsNullOrEmpty(scene.path)) { continue; } var sceneAsset = AssetDatabase.LoadAssetAtPath <SceneAsset>(scene.path); rootScenes.Add(new SceneInfo() { AutoLoad = true, Scene = GlobalObjectId.GetGlobalObjectIdSlow(sceneAsset) }); } return(rootScenes.ToArray()); } else { return(SceneInfos.ToArray()); } }
public void AddScene(SceneInfo si) { if (si == null || si.ParentTaskInfo == this) { return; } si.Remove(); int i = 0; string name = si.Name; while (GetScene(name) != null) { name = si.Name + "_" + (++i).ToString(); } if (i > 0) { si.Name = name; } si.ParentTaskInfo = this; SceneInfos.Add(si); ProjectDoc.Instance.OnAppendedSceneInfo(si); OperationHistory.Instance.IsDirty = true; }
public void Load(Scene _scene) { Application.LoadLevel(SceneInfos.Get(_scene).name); }
public void Execute() { Application.LoadLevel(SceneInfos.Get(scene).name); }
public bool Contains(long id) { return(SceneInfos.ContainsKey(id)); }