예제 #1
0
        public SceneInfo GetSheetInfo(Int64 id)
        {
            var result = default(SceneInfo);

            SceneInfos.TryGetValue(id, out result);
            return(result);
        }
예제 #2
0
        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);
        }
예제 #3
0
        public SceneInfo CreateScene()
        {
            var si = new SceneInfo(this, FreeDefaultSceneName);

            SceneInfos.Add(si);
            return(si);
        }
예제 #4
0
 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));
     }
 }
예제 #5
0
 public void Clear()
 {
     SelectedSceneInfo = null;
     foreach (SceneInfo si in SceneInfos)
     {
         si.Clear();
     }
     SceneInfos.Clear();
 }
예제 #6
0
        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();
        }
예제 #7
0
 public bool RemoveScene(SceneInfo si)
 {
     if (SceneInfos.Contains(si))
     {
         if (SceneInfos.Remove(si))
         {
             OperationHistory.Instance.IsDirty = true;
             return(true);
         }
     }
     return(false);
 }
예제 #8
0
        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);
        }
예제 #9
0
    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;
        }
    }
예제 #10
0
        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);
        }
예제 #11
0
 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);
         }
     }
 }
예제 #12
0
        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"
                });
            }
        }
예제 #13
0
        /// <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());
            }
        }
예제 #14
0
        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);
 }
예제 #16
0
 public void Execute()
 {
     Application.LoadLevel(SceneInfos.Get(scene).name);
 }
예제 #17
0
 public bool Contains(long id)
 {
     return(SceneInfos.ContainsKey(id));
 }