Skip to content

Commit

Permalink
[change][runtime]:兼容Unity2020
Browse files Browse the repository at this point in the history
  • Loading branch information
CatImmortal committed Mar 27, 2023
1 parent cdb771f commit 1f6aaed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
7 changes: 4 additions & 3 deletions Assets/CatAsset/Runtime/Misc/EncryptUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@ public static class EncryptUtil

private static byte[] GetCachedBytes(int length)
{

if (!cachedBytesQueue.TryDequeue(out var bytes))
if (cachedBytesQueue.Count == 0)
{
return new byte[length];
}

byte[] bytes = cachedBytesQueue.Peek();

if (bytes.Length < length)
{
return new byte[length];
}

return bytes;
return cachedBytesQueue.Dequeue();
}

private static void ReleaseCachedBytes(byte[] bytes)
Expand Down
8 changes: 1 addition & 7 deletions Assets/CatAsset/Runtime/Misc/RuntimeUtil.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@

using System;
using System.Buffers;
using System.Collections.Concurrent;
using System;
using System.IO;
using UnityEngine;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using UnityEngine.Networking;
using UnityEngine.Profiling;
using Random = UnityEngine.Random;

namespace CatAsset.Runtime
{
Expand Down

0 comments on commit 1f6aaed

Please sign in to comment.