//Type handleUtilityType; //Type[] types = { }; void OnEnable() { selfScript = (ItemConnectionPoint)target; //handleUtilityType = Type.GetType("HandleUtility, Assembly_CSharp-Editor", false, false); Type[] editorTypes = typeof(Editor).Assembly.GetTypes(); type_HandleUtility = editorTypes.FirstOrDefault<Type>(x => x.Name == "HandleUtility"); meth_IntersectRayMesh = type_HandleUtility.GetMethod("IntersectRayMesh", (BindingFlags.Static | BindingFlags.NonPublic)); }
public virtual bool ConnectToSuppliedPoint(ItemConnectionPoint otherPoint) { if (otherPoint.canConnect == false || otherPoint.isConnected == true) { return false; } Vector3 connectionDistanceVec = connectedObject.position - transform.position; connectedObject.position = otherPoint.transform.position + connectionDistanceVec; //connectedObject.rotation = connectedObject.parent = otherPoint.connectedObject.transform; return true; }
public override bool ConnectToSuppliedPoint(ItemConnectionPoint otherPoint) { bool result = base.ConnectToSuppliedPoint(otherPoint); if (result == true) { physicalCollider.enabled = false; otherPoint.connectedObject.GetComponent<ConstructionItem>().childConstructList.Add(this.connectedObject.GetComponent<ConstructionItem>()); this.connectedObject.GetComponent<ConstructionItem>().parentConstruct = otherPoint.connectedObject.GetComponent<ConstructionItem>(); return true; } return false; }