public void SendRefreshSignal(PowerPlug requestSource) { if (connectedSocket != null) { connectedSocket.SendRefreshSignal(this); } }
public void FindGenerators(PowerPlug requestSource) { if (connectedSocket != null) { connectedSocket.FindGenerators(this); } }
public void RemoveGenerator(PowerGenerator gen, PowerPlug requestSource) { if (connectedSocket != null) { connectedSocket.RemoveGenerator(gen, this); } }
public override void Interact(CharacterInteraction target) { // Connecting the cable if (target.CurrentHeldItem != null && target.CurrentHeldItem is PowerPlug) { target.Equipment.PlaceItem(plugPivotPoint.position, plugPivotPoint.rotation, plugPivotPoint); connectedPlug = (PowerPlug)target.CurrentHeldItem; if (connectedPlug != null) { connectedPlug.SetConnectedSocket(this); connectedPlug.SendRefreshSignal(this); //connectedPlug.FindGenerators(this); } connectedConduit.FindGenerators(); } // Disconnecting the cable if (target.CurrentHeldItem == null && connectedPlug != null) { connectedPlug.ResetComponents(); connectedPlug.Interact(target); connectedPlug.RemoveGenerator(connectedConduit.powerSource, this); connectedPlug.SetConnectedSocket(null); connectedPlug.SendRefreshSignal(this); //connectedPlug.FindGenerators(this); connectedPlug = null; connectedConduit.FindGenerators(); connectedConduit.SendRefreshSignal(); } }
public void FindGenerators(PowerConduit source, PowerPlug requestSource) { if (connectedConduit != source) { connectedConduit.FindGenerators(source, this); } }
public void ReleaseSelectedEnd(PowerPlug tar) { if (tar.primaryEnd && !secondaryPlug.IsConnected) { secondaryPlug.transform.SetParent(transform); } else if (!tar.primaryEnd && !primaryPlug.IsConnected) { primaryPlug.transform.SetParent(transform); } lastSelectedPlug = tar; }
} // If any end is being held by the player public void SetSelectedEnd(PowerPlug tar) { if (tar.primaryEnd && !secondaryPlug.IsConnected) { secondaryPlug.transform.parent = null; } else if (!tar.primaryEnd && !primaryPlug.IsConnected) { primaryPlug.transform.parent = null; } transform.SetParent(null); lastSelectedPlug = tar; }
public void RemoveGenerator(PowerGenerator gen, PowerPlug requestSource) { connectedConduit.RemoveGenerator(gen, this); }
public void FindGenerators(PowerPlug requestSource) { //Debug.Log(gameObject.name + " Received request"); connectedConduit.FindGenerators(); }
public void SendRefreshSignal(PowerPlug requestSource) { connectedConduit.ReceiveRefreshSignal(this); }