public void RemovePipe(PipeData pipeData) { pipeData.OnNet = null; var Outmix = mixAndVolume.Take(pipeData.mixAndVolume); Covering.Remove(pipeData); pipeData.SpillContent(Outmix); SplitPipeNets(); }
public virtual void OnDisable() { AtmosManager.Instance.inGameNewPipes.Remove(this); foreach (var Pipe in ConnectedPipes) { if (Pipe == null) { continue; } Pipe.ConnectedRemove(this); foreach (var Connection in Connections.Directions) { if (Connection.Connected == Pipe) { Connection.Connected = null; } } if (NetCompatible == false) { //This is a special Pipe if (Pipe.NetCompatible == false) { Outputs.Remove(Pipe); } else { Outputs.Remove(Pipe); //Removes itself if it is connected to a network and its a output for the network // this one probably require more work than just null check if (Pipe.OnNet == null) { Logger.LogWarning("Pipe.OnNet == null", Category.Atmos); } else { Pipe.OnNet.RemoveEqualiseWith(this); } } } } ConnectedPipes.Clear(); //managing external listeners if (NetCompatible && OnNet != null) { OnNet.RemovePipe(this); } else { SpillContent(mixAndVolume.Take(mixAndVolume, false)); } //MatrixManager.ReagentReact(mixAndVolume.Mix, MatrixPos); //TODO AAAAAAAA Get the correct location }