/// <summary> /// Provide the disposal outlet a container, from the disposal pipe network, /// from which its contents will be ejected into the world. The container object will be despawned. /// </summary> /// <param name="virtualContainer">The virtual container whose contents will be ejected.</param> public void ServerReceiveAndEjectContainer(DisposalVirtualContainer virtualContainer) { receivedContainers.Add(virtualContainer); virtualContainer.GetComponent <ObjectBehaviour>().parentContainer = objectBehaviour; if (!IsOperating) { StartCoroutine(RunEjectionSequence()); } }
private IEnumerator RunFlushSequence() { // Bin orifice closes... SetBinState(BinState.Flushing); yield return(WaitFor.Seconds(ANIMATION_TIME)); // Bin orifice closed. Release the charge. chargePressure = 0; SoundManager.PlayNetworkedAtPos(FlushSound, registerObject.WorldPositionServer, sourceObj: gameObject); if (virtualContainer != null) { virtualContainer.GetComponent <ObjectBehaviour>().parentContainer = null; DisposalsManager.Instance.NewDisposal(virtualContainer); virtualContainer = null; } // Restore charge. SetBinState(BinState.Recharging); StartCoroutine(Recharge()); }