multiplayer refactor
This commit is contained in:
19
Runtime/Engine/Code/Extensions/NativeArrayEx.cs
Normal file
19
Runtime/Engine/Code/Extensions/NativeArrayEx.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Text;
|
||||
using Unity.Collections;
|
||||
|
||||
namespace RebootKit.Engine.Extensions {
|
||||
public static class NativeArrayEx {
|
||||
public static string ToHexString(this NativeArray<byte> array) {
|
||||
if (array.IsCreated) {
|
||||
StringBuilder sb = new StringBuilder(array.Length * 3);
|
||||
for (int i = 0; i < array.Length; i++) {
|
||||
sb.AppendFormat("{0:X2} ", array[i]);
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
3
Runtime/Engine/Code/Extensions/NativeArrayEx.cs.meta
Normal file
3
Runtime/Engine/Code/Extensions/NativeArrayEx.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2921b0badb164eef8dae6f95a6e4c002
|
||||
timeCreated: 1753068953
|
||||
Reference in New Issue
Block a user