ro-webgl/Assets/Src/Utils/LuaUInt32.cs
2021-12-21 09:40:39 +08:00

19 lines
405 B
C#

using System;
using UnityEngine;
public class LuaUInt32
{
public static byte[] FromString(string str)
{
str = str.Replace("#", "");
UInt32 v;
UInt32.TryParse(str, out v);
Debug.Log(v);
return BitConverter.GetBytes(v);
}
public static UInt32 BytesToUInt32(byte[] v)
{
return BitConverter.ToUInt32(v, 0);
}
}