Skip to content

Commit 8e1d0e3

Browse files
committed
Use string[] for Options.assemblyNames
1 parent bc1a749 commit 8e1d0e3

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 List<string> assemblyNames; // empty means only default assemblies
657+
public 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 List<string>(),
31+
assemblyNames = new string[0],
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
@@ -194,9 +194,9 @@ private void DrawOptions(DllManipulatorOptions options)
194194
GUI.enabled = false;
195195
options.mockAllNativeFunctions = EditorGUILayout.Toggle(TARGET_ALL_NATIVE_FUNCTIONS_GUI_CONTENT, options.mockAllNativeFunctions);
196196

197-
if (EditorGUILayout.Toggle(ONLY_ASSEMBLY_CSHARP_GUI_CONTENT, options.assemblyNames.Count == 0))
197+
if (EditorGUILayout.Toggle(ONLY_ASSEMBLY_CSHARP_GUI_CONTENT, options.assemblyNames.Length == 0))
198198
{
199-
options.assemblyNames.Clear();
199+
options.assemblyNames = new string[0];
200200
}
201201
else
202202
{
@@ -206,8 +206,8 @@ private void DrawOptions(DllManipulatorOptions options)
206206
if (_allKnownAssemblies == null || _lastKnownAssembliesRefreshTime + ASSEMBLIES_REFRESH_INTERVAL < DateTime.Now)
207207
RefreshAllKnownAssemblies();
208208

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

212212
_showTargetAssemblies = EditorGUILayout.Foldout(_showTargetAssemblies, TARGET_ASSEMBLIES_GUI_CONTENT);
213213
if (_showTargetAssemblies)
@@ -230,7 +230,7 @@ private void DrawOptions(DllManipulatorOptions options)
230230
() =>
231231
{
232232
options.assemblyNames = options.assemblyNames
233-
.Concat(_allKnownAssemblies).Distinct().ToList();
233+
.Concat(_allKnownAssemblies).Distinct().ToArray();
234234
});
235235

236236
EditorGUI.indentLevel = prevIndent2;

0 commit comments

Comments
 (0)