public void AddElectricalNode(Vector3Int position, ElectricalCableTile electricalCableTile, bool AddTile = false) { var checkPos = position; checkPos.z = 0; var metaData = metaDataLayer.Get(checkPos, true); var newdata = new ElectricalMetaData(); newdata.Initialise(electricalCableTile, metaData, position, this); metaData.ElectricalData.Add(newdata); if (AddTile) { if (electricalCableTile != null) { if (UnderFloorLayer == null) { underFloorLayer = GetComponentInChildren <UnderFloorLayer>(); } if (UnderFloorLayer != null) { UnderFloorLayer.SetTile(position, electricalCableTile, Matrix4x4.identity); } } } }
public void AddUnderFloorTile(Vector3Int position, LayerTile tile, Matrix4x4 transformMatrix, Color color) { if (UnderFloorLayer == null) { underFloorLayer = GetComponentInChildren <UnderFloorLayer>(); } UnderFloorLayer.SetTile(position, tile, transformMatrix, color); }
private void UnderFloorElectricalSetTile(Connection WireEndA, Connection WireEndB, PowerTypeCategory powerTypeCategory, Vector3Int position, ElectricalMetaData newdata = null) { ElectricalCableTile Tile = ElectricityFunctions.RetrieveElectricalTile(WireEndA, WireEndB, powerTypeCategory); if (newdata != null) { newdata.RelatedTile = Tile; } if (Tile != null) { if (UnderFloorLayer == null) { underFloorLayer = GetComponentInChildren <UnderFloorLayer>(); } if (UnderFloorLayer != null) { UnderFloorLayer.SetTile(position, Tile, Matrix4x4.identity); } } }