public static AddHackingConnection Send(GameObject player, GameObject hackObject, int[] connectionToAdd) { AddHackingConnection msg = new AddHackingConnection { Player = player.GetComponent <NetworkIdentity>().netId, HackableObject = hackObject.GetComponent <NetworkIdentity>().netId, JsonData = JsonConvert.SerializeObject(connectionToAdd), }; msg.Send(); return(msg); }
public void FinishAddingWire(GUI_HackingNode inputNode) { newWireInput = inputNode; newWireOutput.HackNode.AddConnectedNode(newWireInput.HackNode); if (!IsServer) { int outIndex = hackNodes.IndexOf(newWireOutput.HackNode); int inIndex = hackNodes.IndexOf(newWireInput.HackNode); int[] connectionToAdd = { outIndex, inIndex }; AddHackingConnection.Send(PlayerManager.LocalPlayerScript.gameObject, hackProcess.gameObject, connectionToAdd); } isAddingWire = false; }