Example #1
0
    private void DrawSkusView()
    {
        GUILayout.Space(10);
        GUILayout.BeginHorizontal();

        if (MainButton("生成所有搭建动画对应的缩略图配置文件", 30))
        {
            HashSet <string> configFiles = new HashSet <string>();
            mSkuDatas.SkuCarDatas().ForEach(s =>
            {
                if (File.Exists("./" + BuildAnimDir + s.model_sku_id + ".txt"))
                {
                    configFiles.Add(s.model_sku_id + ".txt");
                }
                else
                {
                    Debug.LogErrorFormat("文件>>>>{0}不存在,请确保已更新数据!", "./" + BuildAnimDir + s.model_sku_id + ".txt");
                }
            });

            ResPublisher.CreateBuildingThumbConfigs(configFiles.ToArray(), IsOnline);
        }
        if (MainButton("生成所有搭建动画对应的模型配置文件", 30))
        {
            HashSet <string> configFiles = new HashSet <string>();
            mSkuDatas.SkuCarDatas().ForEach(s =>
            {
                if (File.Exists("./" + BuildAnimDir + s.model_sku_id + ".txt"))
                {
                    configFiles.Add(s.model_sku_id + ".txt");
                }
                else
                {
                    Debug.LogErrorFormat("文件>>>>{0}不存在,请确保已更新数据!", s.model_sku_id);
                }
            });
            ModelPublisher.CreateCustomConfig(configFiles.ToArray(), IsOnline);
        }

        if (MainButton("生成所有SKU对应的共用模型配置文件", 30))
        {
            ModelPublisher.CreateCustomSkuModelResConfig(mSkuDatas, IsOnline);
        }

        GUILayout.EndHorizontal();

        GUILayout.Space(10);
        GUILayout.BeginHorizontal();
        DrawSkuView();
        if (!string.IsNullOrEmpty(mFocusSkuName))
        {
            DrawSkuCarView();
        }
        GUILayout.EndHorizontal();
    }
Example #2
0
    private void DrawSkuCarView()
    {
        if (mCarItems == null)
        {
            return;
        }
        GUILayout.Space(10);
        if (EditorGUILayout.Foldout(true, mFocusSkuName))
        {
            GUILayout.BeginVertical();
            GUILayout.Space(30);
            GUILayout.BeginHorizontal();
            if (MainButton("生成下面所有文件对应的缩略图配置文件", 30))
            {
                List <string> configFiles = new List <string>();
                mCarItems.ForEach(s => { configFiles.Add(s.model_sku_id); });
                ResPublisher.CreateBuildingThumbConfigs(configFiles.ToArray(), IsOnline);
            }
            if (MainButton("生成下面所有文件对应的模型配置文件", 30))
            {
                List <string> configFiles = new List <string>();
                mCarItems.ForEach(s => { configFiles.Add(s.model_sku_id); });
                ModelPublisher.CreateCustomConfig(configFiles.ToArray(), IsOnline);
            }
            GUILayout.EndHorizontal();

            GUILayout.Space(5);

            foreach (var item in mCarItems)
            {
                GUILayout.BeginHorizontal();

                GUILayout.Label(item.model_sku_id, GUILayout.Width(150));
                GUILayout.Label(item.title, GUILayout.Width(150));
                if (GUILayout.Button("生成缩略图配置", GUILayout.Width(120)))
                {
                    ResPublisher.CreateBuildingThumbConfigs(new [] { item.model_sku_id }, IsOnline);
                }
                if (GUILayout.Button("生成模型配置", GUILayout.Width(120)))
                {
                    ModelPublisher.CreateCustomConfig(new [] { item.model_sku_id }, IsOnline);
                }

                GUILayout.EndHorizontal();
            }

            GUILayout.EndVertical();
        }
    }
Example #3
0
    private void DrawNotSkusView()
    {
        GUILayout.Space(10);

        GUILayout.BeginHorizontal();

        if (MainButton("生成所有文件对应的缩略图配置文件", 30))
        {
            ResPublisher.CreateBuildingThumbConfigs(mOtherAnimFiles.ToArray(), IsOnline);
        }
        if (MainButton("生成所有文件对应的模型配置文件", 30))
        {
            ModelPublisher.CreateCustomConfig(mOtherAnimFiles.ToArray(), IsOnline);
        }

        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        mScrollPosNotSku = GUILayout.BeginScrollView(mScrollPosNotSku, GUILayout.Width(600));
        foreach (var item in mOtherAnimFiles)
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label(Path.GetFileNameWithoutExtension(item), GUILayout.Width(150));
            if (GUILayout.Button("缩略图配置", GUILayout.Width(120)))
            {
                ResPublisher.CreateBuildingThumbConfigs(new [] { item }, IsOnline);
            }
            if (GUILayout.Button("模型配置", GUILayout.Width(120)))
            {
                ModelPublisher.CreateCustomConfig(new [] { item }, IsOnline);
            }

            GUILayout.EndHorizontal();
        }
        GUILayout.EndScrollView();
    }