Ejemplo n.º 1
0
        // [MenuItem("Utility/Namespace Encapsulator/Encapsulate Scripts")]
        public static void Run()
        {
            var directory      = System.IO.Path.GetFullPath("Assets/Namespace Encapsulator/Test/");
            var templatePath   = System.IO.Path.GetFullPath("Assets/Namespace Encapsulator/Templates/Script.txt");
            var nsEncapsulator = new NamespaceEncapsulator("MyNameSpace", templatePath, false);

            nsEncapsulator.ScanFiles(directory);
            nsEncapsulator.CheckNamespace();
            nsEncapsulator.EncapsulateScript();
            AssetDatabase.Refresh();
        }
 private void EncapsulateButton()
 {
     GUILayout.Space(10);
     if (GUILayout.Button("Encapsulate"))
     {
         // var directory = System.IO.Path.GetFullPath("Assets/Namespace Encapsulator/Test/");
         var templatePath   = System.IO.Path.GetFullPath("Assets/Namespace Encapsulator/Templates/Script.txt");
         var nsEncapsulator = new NamespaceEncapsulator(namespaceName, templatePath, verbose);
         nsEncapsulator.ScanFiles(path);
         nsEncapsulator.CheckNamespace();
         nsEncapsulator.EncapsulateScript();
         AssetDatabase.Refresh();
     }
 }