Skip to content

Instantly share code, notes, and snippets.

@zoon
Created November 6, 2010 02:34
Show Gist options
  • Save zoon/665141 to your computer and use it in GitHub Desktop.
Save zoon/665141 to your computer and use it in GitHub Desktop.
private void Start()
{
_mousePositions = new Vector2[TimeFliesLikeAnArrow.Length];
for (var i = 0; i < _mousePositions.Length; i++)
{
var ii = i;
_subscriptions.Add(
// Magic happens here:
RxHost.Instance.GUIEvents
.Where(e => e.type == EventType.mouseMove)
.UnityDelay(TimeSpan.FromMilliseconds(ii*100))
.Subscribe(e => _mousePositions[ii] = e.mousePosition)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment