/// <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()); } }
void StorePlayer(MouseDrop interaction) { if (virtualContainer == null) { virtualContainer = SpawnNewContainer(); } virtualContainer.AddPlayer(interaction.DroppedObject.GetComponent <ObjectBehaviour>()); this.RestartCoroutine(AutoFlush(), ref autoFlushCoroutine); }
void StoreItem() { if (virtualContainer == null) { virtualContainer = SpawnNewContainer(); } Inventory.ServerDrop(currentInteraction.HandSlot, currentInteraction.TargetVector); virtualContainer.AddItem(currentInteraction.HandObject.GetComponent <ObjectBehaviour>()); this.RestartCoroutine(AutoFlush(), ref autoFlushCoroutine); }
private void StoreItem(GameObject obj) { if (virtualContainer == null) { virtualContainer = SpawnNewContainer(); } virtualContainer.AddItem(obj.GetComponent <ObjectBehaviour>()); SoundManager.PlayNetworkedAtPos(trashDunkSounds, gameObject.WorldPosServer()); this.RestartCoroutine(AutoFlush(), ref autoFlushCoroutine); }
private void StoreItem(GameObject item) { if (virtualContainer == null) { virtualContainer = SpawnNewContainer(); } virtualContainer.AddItem(item.GetComponent <ObjectBehaviour>()); AudioSourceParameters dunkParameters = new AudioSourceParameters(pitch: RandomDunkPitch); SoundManager.PlayNetworkedAtPos(trashDunkSounds, gameObject.WorldPosServer(), dunkParameters); this.RestartCoroutine(AutoFlush(), ref autoFlushCoroutine); }
public void EjectContents() { if (autoFlushCoroutine != null) { StopCoroutine(autoFlushCoroutine); } if (BinFlushing) { return; } if (virtualContainer == null) { return; } _ = Despawn.ServerSingle(virtualContainer.gameObject); virtualContainer = null; }
IEnumerator RunIntakeSequence() { // Intake orifice closes... SetIntakeOperating(true); DenyEntry(); virtualContainer = SpawnNewContainer(); yield return(WaitFor.Seconds(FLUSH_DELAY)); // Intake orifice closed. Release the charge. SoundManager.PlayNetworkedAtPos(disposalFlushSound, registerObject.WorldPositionServer, sourceObj: gameObject); DisposalsManager.Instance.NewDisposal(virtualContainer); // Restore charge, open orifice. yield return(WaitFor.Seconds(ANIMATION_TIME - FLUSH_DELAY)); virtualContainer = null; AllowEntry(); SetIntakeOperating(false); }
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()); }