Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Move defines to runtime asmdef
Browse files Browse the repository at this point in the history
  • Loading branch information
uurha committed Jan 24, 2024
1 parent 1e79030 commit c8d0f79
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 0 additions & 4 deletions Editor/SettingsTools/ProjectSettingsRegisterer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ namespace Better.EditorTools.SettingsTools
{
public static class ProjectSettingsRegisterer
{
public const string BetterPrefix = nameof(Better);
public const string ProjectPrefix = "Project";
public const string HighlightPrefix = "Highlight Settings";
public const string ResourcesPrefix = nameof(Resources);

[SettingsProviderGroup]
internal static SettingsProvider[] CreateSettingsProvider()
Expand Down
11 changes: 6 additions & 5 deletions Editor/SettingsTools/ProjectSettingsTools.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.IO;
using Better.Tools.Runtime;
using Better.Tools.Runtime.Settings;
using UnityEditor;
using UnityEngine;
Expand All @@ -15,17 +16,17 @@ public ProjectSettingsTools(string namespacePrefix, string settingMenuItem)
{
NamespacePrefix = namespacePrefix;
_folderPaths = new string[]
{ ProjectSettingsRegisterer.BetterPrefix, NamespacePrefix, ProjectSettingsRegisterer.ResourcesPrefix };
var menuItemPrefix = $"{ProjectSettingsRegisterer.BetterPrefix}/{settingMenuItem}";
ProjectSettingKey = $"{ProjectSettingsRegisterer.ProjectPrefix}/{menuItemPrefix}";
{ BetterEditorDefines.BetterPrefix, NamespacePrefix, BetterEditorDefines.ResourcesPrefix };
var menuItemPrefix = $"{BetterEditorDefines.BetterPrefix}/{settingMenuItem}";
ProjectSettingKey = $"{BetterEditorDefines.ProjectPrefix}/{menuItemPrefix}";
}

public ProjectSettingsTools(string namespacePrefix, string settingMenuItem, string[] settingsFolderNames)
{
NamespacePrefix = namespacePrefix;
_folderPaths = settingsFolderNames;
var menuItemPrefix = $"{ProjectSettingsRegisterer.BetterPrefix}/{settingMenuItem}";
ProjectSettingKey = $"{ProjectSettingsRegisterer.ProjectPrefix}/{menuItemPrefix}";
var menuItemPrefix = $"{BetterEditorDefines.BetterPrefix}/{settingMenuItem}";
ProjectSettingKey = $"{BetterEditorDefines.ProjectPrefix}/{menuItemPrefix}";
}

private string GenerateResourcesRelativePath()
Expand Down
5 changes: 5 additions & 0 deletions Runtime/BetterEditorDefines.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
using System.Reflection;
using UnityEngine;

namespace Better.Tools.Runtime
{
public class BetterEditorDefines
{
public const string BetterPrefix = nameof(Better);
public const string ProjectPrefix = "Project";
public const string HighlightPrefix = "Highlight Settings";
public const string ResourcesPrefix = nameof(Resources);
public const string Editor = "UNITY_EDITOR";

public const BindingFlags MethodFlags = BindingFlags.Public | BindingFlags.NonPublic |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "com.uurha.bettereditortools",
"displayName": "Better Editor Tools",
"description": "Collection of useful tools for Unity Editor",
"version": "1.0.67",
"version": "1.0.68",
"unity": "2020.1",
"dependencies": {
"com.uurha.betterdatastructures": "0.1.1",
Expand Down

0 comments on commit c8d0f79

Please sign in to comment.