Skip to content

Commit

Permalink
Merge pull request #2 from hadashiA/ku/fix-2023-older
Browse files Browse the repository at this point in the history
Fix compilation error in unity2022
  • Loading branch information
hadashiA authored May 21, 2024
2 parents 40befec + f51a2b5 commit e73198a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Assets/Unio/NativeFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Threading;
using Unio.Internal;
using Unity.Collections;
using System.Threading.Tasks;
using UnityEngine;

#if UNITY_2023_1_OR_NEWER
Expand All @@ -17,7 +18,7 @@
using BytesTaskType = System.Threading.Tasks.Task<Unity.Collections.NativeArray<byte>>;
using StringTaskType = System.Threading.Tasks.Task<string>;
using BytesCompletionSource = System.Threading.Tasks.TaskCompletionSource<Unity.Collections.NativeArray<byte>>;
using UnitCompletionSource = UnityEngine.AwaitableCompletionSource;
using UnitCompletionSource = System.Threading.Tasks.TaskCompletionSource<bool>;
#endif

namespace Unio
Expand Down Expand Up @@ -113,7 +114,11 @@ public static UnitTaskType WriteAllBytesAsync(string filePath, NativeArray<byte>
try
{
WriteAllBytes(tuple.Item1, tuple.Item2);
tuple.Item3.TrySetResult();
#if UNITY_2023_1_OR_NEWER
tuple.Item3.TrySetResult();
#else
tuple.Item3.TrySetResult(true);
#endif
}
catch (Exception ex)
{
Expand Down

0 comments on commit e73198a

Please sign in to comment.