private void OnTriggerEnter(Collider other) { Part part = other.GetComponentInParent <Part>(); if (part != null) { pickableParts.Add(part); } // part drop if (other == partDrop) { inPartDrop = true; PartDrop dropPartDrop = partDrop.GetComponent <PartDrop>(); Debug.Assert(dropPartDrop != null); dropPartDrop.PlayerEnter(); } }
private void OnTriggerExit(Collider other) { Debug.Log(other); Part part = other.GetComponentInParent <Part>(); if (part != null) { pickableParts.Remove(part); } // part drop if (other == partDrop) { inPartDrop = false; PartDrop dropPartDrop = partDrop.GetComponent <PartDrop>(); Debug.Assert(dropPartDrop != null); dropPartDrop.PlayerExit(); } }