Exemplo n.º 1
0
        public static void PromptUserForNameAuto()
        {
            string templateFilePath = "";
            String targetPath       = EditorUtils.GetDirectoryPathOfSelectedAsset();

            if (targetPath.Contains("CYMCommon"))
            {
                templateFilePath = BaseConstMgr.Path_XTempCYMMonobehaviour;
            }
            else if (targetPath.Contains("_Func"))
            {
                templateFilePath = BaseConstMgr.Path_XTempMonobehaviour;
            }

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

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

            String templateName = Path.GetFileNameWithoutExtension(templateFilePath);

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

            XenoTemplateUtilityWindow.ShowWindow(templateFilePath, templateName, targetPath);
        }
Exemplo n.º 2
0
        //
        // Public methods
        //

        //------------------------------------------------------------------------------
        public static void PromptUserForName(String templateFilePath)
        {
            String targetPath = EditorUtils.GetDirectoryPathOfSelectedAsset();

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

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

            String templateName = Path.GetFileNameWithoutExtension(templateFilePath);

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

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