Skip to content

Instantly share code, notes, and snippets.

@Rokobokode
Rokobokode / TweenExtensions.cs
Created February 11, 2020 20:37
Unity3D: DOTween: Tween As Task
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)
@Rokobokode
Rokobokode / mkdir_cd.sh
Last active November 23, 2015 10:56
bash: mkdir & cd into it as single command
mkdir /home/foo/doc/bar && cd $_
using UnityEngine;
using System.Collections;
public class NetworkInterpolatedTransform : MonoBehaviour
{
public double interpolationBackTime = 0.1;
internal struct State
{
internal double timestamp;