This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Follow : MonoBehaviour { | |
[SerializeField] | |
private Transform follow = null; | |
private Vector3 originalLocalPosition; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class TweenExtensions | |
{ | |
public static Task AsTask(this Tween tween, CancellationToken cancellationToken) | |
{ | |
var taskCompletionSource = new TaskCompletionSource<bool>(); | |
tween.OnComplete(() => { taskCompletionSource.TrySetResult(true); }); | |
tween.OnKill(() => { taskCompletionSource.TrySetCanceled(); }); | |
if (cancellationToken != CancellationToken.None) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UnityWebRequestAwaiter : INotifyCompletion | |
{ | |
private UnityWebRequestAsyncOperation asyncOp; | |
private Action continuation; | |
public UnityWebRequestAwaiter(UnityWebRequestAsyncOperation asyncOp) | |
{ | |
this.asyncOp = asyncOp; | |
asyncOp.completed += OnRequestCompleted; | |
} |