Created
November 6, 2010 02:34
-
-
Save zoon/665141 to your computer and use it in GitHub Desktop.
This file contains 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
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