コード例 #1
0
    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);
    }
コード例 #2
0
ファイル: GUI_Hacking.cs プロジェクト: ktndrnl/unitystation
    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;
    }