public static void Open(AssetData assetData)
 {
     if (window == null)
     {
         window         = EditorWindow.GetWindow <FguiRefDetailsEditorWindow>("引用详情");
         window.minSize = new Vector2(600, 500);
     }
     window.assetData = assetData;
     window.Show();
     window.Repaint();
 }
Ejemplo n.º 2
0
        private void DrawNouseItem(int index, AssetData file)
        {
            int width  = 100;
            int height = 25;

            EditorGUILayout.BeginHorizontal(HStyle.boxTableHeadStyle);

            file.isSelected = GUILayout.Toggle(file.isSelected, "", GUILayout.Width(30));


            if (GUILayout.Button("删除", HStyle.boxMiddleCenterStyle, GUILayout.Width(100), GUILayout.Height(height)))
            {
                file.package.RemoveImageXml(file);
                file.package.RemoveResource(file);

                if (File.Exists(file.pathForFull))
                {
                    File.Delete(file.pathForFull);
                }
                //AssetDatabase.Refresh();
            }


            if (GUILayout.Button("选中资源", HStyle.boxMiddleCenterStyle, GUILayout.Width(100), GUILayout.Height(height)))
            {
                Shell.ShowInExplorer(file.pathForFull);
                //Selection.activeObject = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(file.pathForAssets);
            }

            if (GUILayout.Button("引用详情", HStyle.boxMiddleCenterStyle, GUILayout.Width(100), GUILayout.Height(height)))
            {
                FguiRefDetailsEditorWindow.Open(file);
            }

            bool export = GUILayout.Toggle(file.exported, "是否导出", GUILayout.Width(100), GUILayout.Height(height));

            if (export != file.exported)
            {
                file.package.SetImageExport(file, export);
            }


            GUILayout.Space(10);
            GUILayout.Label(index.ToString(), HStyle.labelMiddleCenterStyle, GUILayout.Width(width), GUILayout.Height(height));

            GUILayout.Space(10);
            GUILayout.Label(file.pathForAssets, GUILayout.Height(height));
            GUILayout.Space(10);

            EditorGUILayout.EndHorizontal();
        }
Ejemplo n.º 3
0
        private void DrawItem(int index, List <AssetData> md5files)
        {
            int width  = 100;
            int height = 25;

            EditorGUILayout.BeginHorizontal(HStyle.boxTableHeadStyle);
            GUILayout.Label(index.ToString(), HStyle.labelMiddleCenterStyle, GUILayout.Width(width), GUILayout.Height(height));

            if (isSetDict.ContainsKey(index) && isSetDict[index])
            {
                GUILayout.Label("已设置", GUILayout.Width(60), GUILayout.Height(height));
            }

            EditorGUILayout.BeginVertical();
            for (int i = 0; i < md5files.Count; i++)
            {
                EditorGUILayout.BeginHorizontal();
                AssetData file = md5files[i];

                if (GUILayout.Button("选中", HStyle.boxMiddleCenterStyle, GUILayout.Width(100), GUILayout.Height(height)))
                {
                    Selection.activeObject = AssetDatabase.LoadAssetAtPath <UnityEngine.Object>(file.path);
                }


                if (GUILayout.Button("设为主资源", HStyle.boxMiddleCenterStyle, GUILayout.Width(100), GUILayout.Height(height)))
                {
                    SetMainRes(index, md5files, file);
                }



                if (GUILayout.Button("移至 Common", HStyle.boxMiddleCenterStyle, GUILayout.Width(100), GUILayout.Height(height)))
                {
                    file.MoveToCommon();
                }


                if (GUILayout.Button("引用详情", HStyle.boxMiddleCenterStyle, GUILayout.Width(100), GUILayout.Height(height)))
                {
                    FguiRefDetailsEditorWindow.Open(file);
                }

                if (GUILayout.Button("打开 Common", HStyle.boxMiddleCenterStyle, GUILayout.Width(100), GUILayout.Height(height)))
                {
                    file.ShowInExplorerForCommon();
                }

                bool export = GUILayout.Toggle(file.exported, "是否导出", GUILayout.Width(100), GUILayout.Height(height));
                if (export != file.exported)
                {
                    file.package.SetImageExport(file, export);
                }



                GUILayout.Space(10);
                GUILayout.Label(file.beDependCount.ToString(), GUILayout.Width(width), GUILayout.Height(height));

                GUILayout.Space(10);
                GUILayout.Label(file.pathForAssets, GUILayout.Height(height));
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndVertical();


            EditorGUILayout.EndHorizontal();
        }