Skip to content

Instantly share code, notes, and snippets.

@OlegJakushkin
Created March 26, 2016 13:32
Show Gist options
  • Save OlegJakushkin/17da758601aac5bf62a7 to your computer and use it in GitHub Desktop.
Save OlegJakushkin/17da758601aac5bf62a7 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Accord.MachineLearning.Structures;
public class Controller : MonoBehaviour {
private readonly Dictionary<Vector3, Informer> map = new Dictionary<Vector3, Informer>();
private readonly KDTree<Informer> tree = new KDTree<Informer> ();
public void RegisterInformer(Informer informer) {
var position = informer.transform.position;
map.Add (position, informer);
Debug.Log ("Informer added at: " + position);
tree.Add (position, informer);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment