public virtual void OnDisable() { AtmosManager.Instance.inGameNewPipes.Remove(this); foreach (var Pipe in ConnectedPipes) { Pipe.ConnectedRemove(this); 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 Pipe.OnNet.RemoveEqualiseWith(this); } } } //managing external listeners if (NetCompatible && OnNet != null) { OnNet.RemovePipe(this); } //MatrixManager.ReagentReact(mixAndVolume.Mix, MatrixPos); //TODO AAAAAAAA Get the correct location }
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 }