Exemple #1
0
        static SwfSymbolData LoadSymbol(
            string swf_path, string symbol_name, SwfLibrary library, List <SwfTagBase> tags)
        {
            var warnings = new HashSet <string>();
            var disp_lst = new SwfDisplayList();
            var executer = new SwfContextExecuter(library, 0, warning_msg => {
                warnings.Add(warning_msg);
            });
            var symbol_frames = new List <SwfFrameData>();

            while (executer.NextFrame(tags, disp_lst))
            {
                _progressBar.UpdateProgress(
                    string.Format("swf symbols loading ({0})", symbol_name),
                    (float)(executer.CurrentTag + 1) / tags.Count);
                symbol_frames.Add(LoadSymbolFrameData(library, disp_lst, warning_msg => {
                    warnings.Add(warning_msg);
                }));
            }
            foreach (var warning in warnings)
            {
                Debug.LogWarningFormat(
                    AssetDatabase.LoadMainAssetAtPath(swf_path),
                    "<b>[FlashTools]</b> {0}\nSwf path: {1}",
                    warning, swf_path);
            }
            return(new SwfSymbolData {
                Name = symbol_name,
                Frames = symbol_frames
            });
        }
        static SwfSymbolData LoadSymbol(
            string symbol_name, SwfLibrary library, List <SwfTagBase> tags)
        {
            var disp_lst = new SwfDisplayList();
            var executer = new SwfContextExecuter(library, 0, warning_msg => {
                Debug.LogWarningFormat("<b>[FlashTools]</b> {0}", warning_msg);
            });
            var symbol_frames = new List <SwfFrameData>();

            while (executer.NextFrame(tags, disp_lst))
            {
                _progressBar.UpdateProgress(
                    string.Format("swf symbols loading ({0})", symbol_name),
                    (float)(executer.CurrentTag + 1) / tags.Count);
                symbol_frames.Add(LoadSymbolFrameData(library, disp_lst));
            }
            return(new SwfSymbolData {
                Name = symbol_name,
                Frames = symbol_frames
            });
        }