Ejemplo n.º 1
0
        // get the folder refer to resource
        // first : res/
        // then: res.txt
        // then : res/res.txt
        private List <string> getResFolder()
        {
            List <string> paths = new List <string>();
            var           dir   = new Godot.Directory();

            if (dir.DirExists("res://res/"))
            {
                paths.Add(GameManager.Instance.PrjPath + "res");
            }
            dir.Dispose();

            using (var file = new Godot.File()) {
                if (!_getResFolder(file, "res://res.txt", paths))
                {
                    if (!_getResFolder(file, "res://res/res.txt", paths))
                    {
                        if (paths.Count == 0)
                        {
                            Debug.LogError("no res folder found!");
                        }
                    }
                }
            }
            return(paths);
        }