Beispiel #1
0
        public string Find(string assetName, string currentPath = null)
        {
            if (currentPath != null && File.Exists(currentPath + assetName))
            {
                return(currentPath + assetName);
            }

            if (currentPath != null)
            {
                ContentManager.AddHint(currentPath);
            }
            if (assetName.IndexOf(".") > -1)
            {
                assetName = assetName.Substring(0, assetName.LastIndexOf("."));
            }

            string hints = GetHints(currentPath);

            if (hints != null)
            {
                foreach (string hint in hints.Split(';'))
                {
                    ContentManager.AddHint(hint);
                }
            }

            if (ContentManager.LoadOrDefaultFile(assetName, GetExtension(), out string path))
            {
                return(path);
            }
            else
            {
                return(null);
            }
        }