Ejemplo n.º 1
0
        //
        // Public methods
        //

        public static void PromptUserForNameAuto()
        {
            string templateFilePath = "";
            String targetPath       = EditorUtil.GetDirectoryPathOfSelectedAsset();

            if (targetPath.Contains("CYMCommon"))
            {
                templateFilePath = Const.RPath_TempCYMMonobehaviour;
            }
            else if (targetPath.Contains("CSharp"))
            {
                templateFilePath = Const.RPath_TempCSharp;
            }
            else
            {
                templateFilePath = Const.RPath_TempMonobehaviour;
            }

            if (String.IsNullOrEmpty(targetPath))
            {
                targetPath = "Assets";
            }

            if (!File.Exists(templateFilePath))
            {
                return;
            }

            String templateName = Path.GetFileNameWithoutExtension(templateFilePath);

            templateName = Regex.Replace(templateName, @"\W", "");

            TemplateUtilityWindow.ShowWindow(templateFilePath, templateName, targetPath);
        }
Ejemplo n.º 2
0
        public static void ShowTemplate(string name)
        {
            String targetPath       = EditorUtil.GetDirectoryPathOfSelectedAsset();
            string templateFilePath = Path.Combine(Const.RPath_Common, "_Res/Configs/TemplateFiles/" + name + ".asset");

            if (String.IsNullOrEmpty(targetPath))
            {
                targetPath = "Assets";
            }
            if (!File.Exists(templateFilePath))
            {
                return;
            }
            String templateName = Path.GetFileNameWithoutExtension(templateFilePath);

            templateName = Regex.Replace(templateName, @"\W", "");
            TemplateUtilityWindow.ShowWindow(templateFilePath, templateName, targetPath);
        }
Ejemplo n.º 3
0
        //------------------------------------------------------------------------------
        public static void PromptUserForName(String templateFilePath)
        {
            String targetPath = EditorUtil.GetDirectoryPathOfSelectedAsset();

            if (String.IsNullOrEmpty(targetPath))
            {
                targetPath = "Assets";
            }

            if (!File.Exists(templateFilePath))
            {
                return;
            }

            String templateName = Path.GetFileNameWithoutExtension(templateFilePath);

            templateName = Regex.Replace(templateName, @"\W", "");

            TemplateUtilityWindow.ShowWindow(templateFilePath, templateName, targetPath);
        }