private void OnTriggerEnter(Collider other) { if (other.GetComponent <AbstractPoint>() != null) { snapToPoint(other); if (center) { thisArctus.Center = other.gameObject.GetComponent <AbstractPoint>(); if (thisArctus.edgeHandle == null) { edge = thisArctus.spawnEdge(other.transform.position); } } else { if (thisArctus != null) { thisArctus.Edge = other.gameObject.GetComponent <AbstractPoint>(); GetComponent <InteractionBehaviour>().enabled = false; this.transform.parent = thisArctus.Edge.transform; } else { Debug.Log("This handle wants a reference to the arctus behave. " + name); } } } }
internal arctusHandle spawnEdge(Vector3 position) { edgeHandle = Instantiate(handlePrefab).GetComponent <arctusHandle>(); edgeHandle.thisArctus = this; edgeHandle.transform.position = .2f * Vector3.up + this.transform.position; return(edgeHandle); }