示例#1
0
        public IEnumerator LoadImage(string filepath)
        {
            var popup = PopupLoading.Creat();

            yield return(new WaitForEndOfFrame());

            //WWW www = new WWW ("file://" + filepath);
            WWW www = new WWW(ConfigUtility.fileLoadPath(filepath));

            yield return(www);

            Destroy(popup);
            yield return(new WaitForEndOfFrame());

            try {
                if (ConfigUtility.isSupportedTextureType(Path.GetExtension(filepath)))
                {
                    editor.gameScreen.setBackgroundImage(www.texture);
                }
                else
                {
                    editor.debugLog.LogWarning(ExceptionList.openFileError.Value);
                    yield break;
                }
            } catch {
                editor.debugLog.LogWarning(ExceptionList.openFileError.Value);
                yield break;
            }
            editor.getTrackMap.header.BackgroundFileFullName = filepath;
            editor.debugLog.Log(MessageList.openFileSuccess.Value);
        }