public static void ConnectionFinal() { if (WirePlacer.CurrentWirePlacementIsValid()) { var wireBeingPlaced = ModUtilities.GetStaticFieldValue <GameObject>(typeof(WirePlacer), "WireBeingPlaced"); var wire = wireBeingPlaced.GetComponent <Wire>(); Network.SendPacket(PlaceWirePacket.BuildFromLocalWire(wire)); } }
public void SaveAnotherSelection(bool advance = true) { GameObject a = ModUtilities.GetStaticFieldValue <GameObject>(typeof(WirePlacer), "SelectedPeg"); GameObject b = ModUtilities.GetStaticFieldValue <GameObject>(typeof(WirePlacer), "PegBeingLookedAt"); Vector3 point1, point2; point1 = a.transform.GetChild(0).position; point2 = b.transform.GetChild(0).position; var l = Selections[CurrentSelectionIndex]; if (!IsSelected(a)) { l.Add(a); Highlighter.Highlight(a, CurrentSelectionIndex); } foreach (var item in Physics.RaycastAll(point1, point2 - point1, Vector3.Distance(point1, point2))) { if (item.collider.tag == "Input" || item.collider.tag == "Output") { if (IsSelected(item.collider.gameObject)) { continue; } l.Add(item.collider.gameObject); Highlighter.Highlight(item.collider.gameObject, CurrentSelectionIndex); } } if (advance) { NextSelection(); } }