Ejemplo n.º 1
0
        private void DrawKey()                                  // 快捷键
        {
            MyCreate.Box(() =>
            {
                m_Tools.TextText_BL("Ctrl + W", "复制 UGUI 名到剪切版", -50);
                m_Tools.Text_G("使用它,再也不用烦找名字的痛苦了");
            });
            AddSpace();


            MyCreate.Box(() =>
            {
                m_Tools.Text_Y("先点击选择多个图片,给它们添加前缀");
                Texture2D[] texs = Selection.GetFiltered <Texture2D>(SelectionMode.Assets);
                bool isCanClick  = (null == texs || texs.Length <= 0);
                GUI.enabled      = !isCanClick;
                MyCreate.Button("    一键添加前缀", () =>
                {
                    foreach (Texture2D texture2 in texs)
                    {
                        string assetPath = AssetDatabase.GetAssetPath(texture2);
                        string fullPath  = MyAssetUtil.GetFullPath(assetPath);
                        string fileName  = MyAssetUtil.GetFileNameByFullName(fullPath);
                        MyIO.FileRename(fullPath, "EX_" + fileName);
                    }

                    AssetDatabase.Refresh();
                });


                GUI.enabled = true;
            });
        }