mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-10-09 00:26:11 +00:00
提交Unity 联机Pro
This commit is contained in:
19
JNFrame2/Assets/JNGame/Util/ToUtil.cs
Normal file
19
JNFrame2/Assets/JNGame/Util/ToUtil.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace Plugins.JNGame.Util
|
||||
{
|
||||
public class ToUtil
|
||||
{
|
||||
public static int Byte4ToInt(byte[] data)
|
||||
{
|
||||
return BitConverter.ToInt32(data, 0);
|
||||
}
|
||||
|
||||
public static byte[] IntToByte4(int value)
|
||||
{
|
||||
byte[] result = new byte[4];
|
||||
BitConverter.GetBytes(value).CopyTo(result, 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user