public SpatialHash hash; //hash in which to store this object void Start() { if (hash == null) { Debug.LogError("Trying to add this object to a null SpatialHash!"); } else { hash.Include(this.gameObject); } }
private SpatialHash hash; //hash in which to store this object void Start() { hash = GameObject.Find(hashName).GetComponent <SpatialHash>(); if (hash == null) { Debug.LogError("HashObject cannot find SpatialHash by name " + hashName + "!"); } else { hash.Include(this.gameObject); } }