示例#1
0
        public static void CreateSettingsAsset(string settingsPath)
        {
            NamespacerSettings settings = ScriptableObject.CreateInstance <NamespacerSettings>();

            settings.Init();

            if (!Directory.Exists("Assets/Resources"))
            {
                Directory.CreateDirectory("Assets/Resources");
            }

            AssetDatabase.CreateAsset(settings, settingsPath);
            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();
        }
示例#2
0
        public static string GetNamespace(string path, NamespacerSettings namespacerSettings)
        {
            string namespacePath = "";
            string rootNamespace = namespacerSettings.rootNamespace;

            if (rootNamespace == string.Empty)
            {
                rootNamespace = PlayerSettings.productName;
            }

            // Strip any whitespace out of the root namespace.
            rootNamespace = rootNamespace.Replace(" ", "");

            if (namespacerSettings.shouldIgnoreHierarchy)
            {
                namespacePath = rootNamespace;
            }
            else
            {
                namespacePath = GetNamespaceFromHierarchy(path, rootNamespace, namespacerSettings.rootFolder);
            }

            return(namespacePath);
        }
示例#3
0
 public NamespacerCore(NamespacerSettings namespacerSettings)
 {
     _namespacerSettings = namespacerSettings;
 }