(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /* | |
| http://entitycrisis.blogspot.com/2010/02/spatial-hash-class-in-c.html | |
| This is a rather useful class, the Spatial Hash. It is used for creating an index of spatial data (3D things in space) and allowing fast queries to be run against the index. | |
| Effectively, you can use this class to ask, "I'm at this position, what other objects are near me?". | |
| */ | |
| using UnityEngine; //This needs to be 'removed' to make 'universal', i.e. not tied to Unity3D | |
| using System.Collections; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| using UnityEngine; | |
| using System.Collections; | |
| public class QuadTreeTest : MonoBehaviour { | |
| public class TestObject : IQuadTreeObject{ | |
| private Vector3 m_vPosition; | |
| public TestObject(Vector3 position){ | |
| m_vPosition = position; | |
| } | |
| public Vector2 GetPosition(){ |
| // ES6 | |
| class AngularPromise extends Promise { | |
| constructor(executor) { | |
| super((resolve, reject) => { | |
| // before | |
| return executor(resolve, reject); | |
| }); | |
| // after | |
| } |
| using UnityEngine; | |
| using System.Collections; | |
| public class QuadTreeTest : MonoBehaviour { | |
| public class TestObject : IQuadTreeObject{ | |
| private Vector3 m_vPosition; | |
| public TestObject(Vector3 position){ | |
| m_vPosition = position; | |
| } | |
| public Vector2 GetPosition(){ |
Note:
When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.
If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code: