Beispiel #1
0
        public static void CreateScriptAssetFromTemplateFile(object context)
        {
            var filePath = (string)context;

            if (filePath.IsExistsFile())
            {
                ProjectBrowserUtils.CreateScriptAssetFromTemplateFile(filePath);
            }
            else
            {
                HEditorDialog.Info(SS._Templatefilenotfound);
                //ScriptTemplatesWindow.Open();
            }
        }
Beispiel #2
0
        /// <summary>
        /// 指定したパスをファイラで開きます
        /// </summary>
        /// <param name="path"></param>
        public static void OpenDirectory(string path)
        {
            path = path.PrettyDirectoryName();

            if (UnitySymbol.UNITY_EDITOR_WIN)
            {
                if (!path.IsExistsDirectory())
                {
                    UnityDebug.LogWarning($"ShellOpenDirectory: Not Found: {path}");
                    HEditorDialog.Warning($"Not Found Directory\n{path}");
                    return;
                }

                // RevealInFinderは開きたいフォルダを選択した状態なのでエクスプローラで開く
                // "\\"はエクスプローラの都合を考えて付けたほうが無難かと思った
                path = $"{path.separatorToOS()}\\";
                Start(kExplorer, path);
            }
            else
            {
                // ??? 動作未確認
                EditorUtility.RevealInFinder(path);
            }
        }
Beispiel #3
0
 /// <summary>
 /// 確認チェック付きのSwitchプラットフォーム
 /// </summary>
 /// <param name="group"></param>
 /// <param name="target"></param>
 /// <returns></returns>
 public static bool SwitchActiveBuildTarget(BuildTargetGroup group, BuildTarget target)
 {
     return(HEditorDialog.Confirm($"{ S._RequiresSwitchActiveBuildTarget}\n{S._IsitOK_}", () => {
         EditorUserBuildSettings.SwitchActiveBuildTarget(group, target);
     }));
 }