mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-15 22:50:56 +00:00
tweak
This commit is contained in:
parent
709cc4c905
commit
2c51ec4a36
@ -25,12 +25,12 @@ namespace QSB.Player
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DebugLog.DebugWrite($"WARP TASK {player.PlayerId}");
|
|
||||||
|
|
||||||
var go = new GameObject(nameof(JoinLeaveSingularity));
|
var go = new GameObject(nameof(JoinLeaveSingularity));
|
||||||
var ct = go.GetCancellationTokenOnDestroy();
|
var ct = go.GetCancellationTokenOnDestroy();
|
||||||
UniTask.Create(async () =>
|
UniTask.Create(async () =>
|
||||||
{
|
{
|
||||||
|
DebugLog.DebugWrite($"WARP TASK {player.PlayerId}");
|
||||||
|
|
||||||
await Run(go.transform, player, joining, ct).SuppressCancellationThrow();
|
await Run(go.transform, player, joining, ct).SuppressCancellationThrow();
|
||||||
Object.Destroy(go);
|
Object.Destroy(go);
|
||||||
|
|
||||||
@ -125,17 +125,16 @@ namespace QSB.Player
|
|||||||
effect.WarpObjectOut(0);
|
effect.WarpObjectOut(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
var tcs = new UniTaskCompletionSource();
|
effect.OnWarpComplete += () =>
|
||||||
effect.OnWarpComplete += () => tcs.TrySetResult();
|
{
|
||||||
await tcs.Task.AttachExternalCancellation(ct);
|
|
||||||
DebugLog.DebugWrite($"WARP DONE {player.PlayerId}");
|
DebugLog.DebugWrite($"WARP DONE {player.PlayerId}");
|
||||||
|
|
||||||
if (!joining)
|
if (!joining)
|
||||||
{
|
{
|
||||||
Object.Destroy(fakePlayer);
|
Object.Destroy(fakePlayer);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
await UniTask.WaitUntil(() => !singularity._owOneShotSource.isPlaying, cancellationToken: ct);
|
await UniTask.WaitUntil(() => !effect.enabled && !singularity._owOneShotSource.isPlaying, cancellationToken: ct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user