Skip to content

Commit e64dd99

Browse files
committed
Revert "Use string[] for Options.assemblyNames"
This reverts commit 8e1d0e3.
1 parent 6ca1ba0 commit e64dd99

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

scripts/DllManipulator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ private static IntPtr SysGetDllProcAddress(IntPtr libHandle, string symbol)
654654
public class DllManipulatorOptions
655655
{
656656
public string dllPathPattern;
657-
public string[] assemblyNames; // empty means only default assemblies
657+
public List<string> assemblyNames; // empty means only default assemblies
658658
public DllLoadingMode loadingMode;
659659
public PosixDlopenFlags posixDlopenFlags;
660660
public bool threadSafe;

scripts/DllManipulatorScript.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class DllManipulatorScript : MonoBehaviour
2828
#else // UNITY_STANDALONE_WIN Windows fallback
2929
"{assets}/Plugins/__{name}.dll",
3030
#endif
31-
assemblyNames = new string[0],
31+
assemblyNames = new List<string>(),
3232
loadingMode = DllLoadingMode.Lazy,
3333
posixDlopenFlags = PosixDlopenFlags.Lazy,
3434
threadSafe = false,

scripts/Editor/DllManipulatorEditor.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ private void DrawOptions(DllManipulatorOptions options)
195195

196196
options.mockAllNativeFunctions = EditorGUILayout.Toggle(TARGET_ALL_NATIVE_FUNCTIONS_GUI_CONTENT, options.mockAllNativeFunctions);
197197

198-
if (EditorGUILayout.Toggle(ONLY_ASSEMBLY_CSHARP_GUI_CONTENT, options.assemblyNames.Length == 0))
198+
if (EditorGUILayout.Toggle(ONLY_ASSEMBLY_CSHARP_GUI_CONTENT, options.assemblyNames.Count == 0))
199199
{
200-
options.assemblyNames = new string[0];
200+
options.assemblyNames.Clear();
201201
}
202202
else
203203
{
@@ -207,8 +207,8 @@ private void DrawOptions(DllManipulatorOptions options)
207207
if (_allKnownAssemblies == null || _lastKnownAssembliesRefreshTime + ASSEMBLIES_REFRESH_INTERVAL < DateTime.Now)
208208
RefreshAllKnownAssemblies();
209209

210-
if (options.assemblyNames.Length == 0)
211-
options.assemblyNames = DllManipulator.DEFAULT_ASSEMBLY_NAMES;
210+
if (options.assemblyNames.Count == 0)
211+
options.assemblyNames.AddRange(DllManipulator.DEFAULT_ASSEMBLY_NAMES);
212212

213213
_showTargetAssemblies = EditorGUILayout.Foldout(_showTargetAssemblies, TARGET_ASSEMBLIES_GUI_CONTENT);
214214
if (_showTargetAssemblies)
@@ -231,7 +231,7 @@ private void DrawOptions(DllManipulatorOptions options)
231231
() =>
232232
{
233233
options.assemblyNames = options.assemblyNames
234-
.Concat(_allKnownAssemblies).Distinct().ToArray();
234+
.Concat(_allKnownAssemblies).Distinct().ToList();
235235
});
236236

237237
EditorGUI.indentLevel = prevIndent2;

0 commit comments

Comments
 (0)