示例#1
0
        public App(Main main)
        {
            this.main         = main;
            appUI             = main.GetComponent <AppUI>().Init();
            currentUnpackMode = (UnpackMode)appUI.m_Dropdown_SelectMode.value;

            //编辑器下测试用
#if UNITY_EDITOR
            plistFilePath = "Assets/Test/elem.plist";
            pngFilePath   = "Assets/Test/elem.png";
            main.StartCoroutine(LoadFiles());
#endif

            RegisterEvents();
        }
示例#2
0
        public App(Main main)
        {
            this.main         = main;
            appUI             = main.GetComponent <AppUI>().Init();
            currentUnpackMode = (UnpackMode)appUI.m_Dropdown_SelectMode.value;

            //编辑器下测试用
//#if UNITY_EDITOR
//            plistFilePath = @"F:\assets\Art\Monster\mon_058.plist";
//            pngFilePath = @"F:\assets\Art\Monster\mon_058.pvr.ccz";
//            main.StartCoroutine(LoadFiles());
//#endif

            RegisterEvents();
        }
示例#3
0
        public App(Main main)
        {
            this.main         = main;
            appUI             = main.GetComponent <AppUI>().Init();
            currentUnpackMode = (UnpackMode)appUI.m_Dropdown_SelectMode.value;

            //编辑器下测试用
#if UNITY_EDITOR
            plistFilePath = @"C:\Users\Administrator\Desktop\plist&png\test.plist";
            pngFilePath   = @"C:\Users\Administrator\Desktop\plist&png\test.png";
            main.StartCoroutine(LoadFiles());
#endif

            RegisterEvents();
        }
示例#4
0
        private void Start()
        {
            Screen.SetResolution(800, 600, false);
            main              = this;
            appUI             = GetComponent <AppUI>();
            currentUnpackMode = (UnpackMode)appUI.m_Dropdown_SelectMode.value;

#if UNITY_EDITOR
            //测试用
            plistFilePath = @"C:\Users\Administrator\Desktop\999.plist";
            pngFilePath   = @"C:\Users\Administrator\Desktop\999.png";
            StartCoroutine(LoadFiles());
#endif

            RegisterEvents();
        }
示例#5
0
        private void RegisterEvents()
        {
            main.GetComponent <FilesOrFolderDragInto>().AddEventListener((List <string> aPathNames) =>
            {
                if (isExecuting)
                {
                    appUI.SetTip("正在执行\n请等待结束");
                    return;
                }

                if (aPathNames.Count > 1)
                {
                    appUI.SetTip("只可拖入一个文件");
                    return;
                }
                else
                {
                    string path = aPathNames[0];
                    if (path.EndsWith(".plist"))
                    {
                        plistFilePath = path;
                        pngFilePath   = Path.GetDirectoryName(path) + @"\" + Path.GetFileNameWithoutExtension(path) + ".png";
                        if (!File.Exists(pngFilePath))
                        {
                            appUI.SetTip("不存在与当前plist文件同名的png文件");
                            return;
                        }
                    }
                    else if (path.EndsWith(".png"))
                    {
                        pngFilePath   = path;
                        plistFilePath = Path.GetDirectoryName(path) + @"\" + Path.GetFileNameWithoutExtension(path) + ".plist";
                        if (!File.Exists(plistFilePath))
                        {
                            appUI.SetTip("不存在与当前png文件同名的plist文件");
                            return;
                        }
                    }
                    else
                    {
                        appUI.SetTip("请放入 plist或png 文件");
                        return;
                    }

                    main.StartCoroutine(LoadFiles());
                }
            });

            appUI.m_Btn_Excute.onClick.AddListener(() =>
            {
                if (isExecuting)
                {
                    appUI.SetTip("正在执行\n请等待结束");
                    return;
                }

                if (loader == null || plist == null)
                {
                    appUI.SetTip("没有指定可执行的plist&png");
                    return;
                }

                isExecuting = true;
                core        = new Core(this);

                main.StartCoroutine(Unpack());
            });

            appUI.m_Dropdown_SelectMode.onValueChanged.AddListener((value) =>
            {
                currentUnpackMode = (UnpackMode)value;
            });
        }