1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-15 22:56:30 +09:00

Unity Support. Just compile with __CONSTRAINED__ and UNITY keyworkds and add a reference to UnityEngine.dll

This commit is contained in:
Andrés Leone
2015-12-13 03:42:39 +01:00
parent 6dac4d7457
commit 208f129e3f
2 changed files with 14 additions and 2 deletions

View File

@@ -7,18 +7,30 @@ namespace Lidgren.Network
public class NetAESEncryption : NetCryptoProviderBase
{
public NetAESEncryption(NetPeer peer)
#if UNITY
: base(peer, new RijndaelManaged())
#else
: base(peer, new AesCryptoServiceProvider())
#endif
{
}
public NetAESEncryption(NetPeer peer, string key)
#if UNITY
: base(peer, new RijndaelManaged())
#else
: base(peer, new AesCryptoServiceProvider())
#endif
{
SetKey(key);
}
public NetAESEncryption(NetPeer peer, byte[] data, int offset, int count)
#if UNITY
: base(peer, new RijndaelManaged())
#else
: base(peer, new AesCryptoServiceProvider())
#endif
{
SetKey(data, offset, count);
}