コード例 #1
0
 /// <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());
     }
 }
コード例 #2
0
ファイル: DisposalBin.cs プロジェクト: talentone/unitystation
        void StorePlayer(MouseDrop interaction)
        {
            if (virtualContainer == null)
            {
                virtualContainer = SpawnNewContainer();
            }
            virtualContainer.AddPlayer(interaction.DroppedObject.GetComponent <ObjectBehaviour>());

            this.RestartCoroutine(AutoFlush(), ref autoFlushCoroutine);
        }
コード例 #3
0
ファイル: DisposalBin.cs プロジェクト: talentone/unitystation
        void StoreItem()
        {
            if (virtualContainer == null)
            {
                virtualContainer = SpawnNewContainer();
            }
            Inventory.ServerDrop(currentInteraction.HandSlot, currentInteraction.TargetVector);
            virtualContainer.AddItem(currentInteraction.HandObject.GetComponent <ObjectBehaviour>());

            this.RestartCoroutine(AutoFlush(), ref autoFlushCoroutine);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
ファイル: DisposalBin.cs プロジェクト: AlexTheM8/unitystation
        public void EjectContents()
        {
            if (autoFlushCoroutine != null)
            {
                StopCoroutine(autoFlushCoroutine);
            }
            if (BinFlushing)
            {
                return;
            }
            if (virtualContainer == null)
            {
                return;
            }

            _ = Despawn.ServerSingle(virtualContainer.gameObject);
            virtualContainer = null;
        }
コード例 #7
0
        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);
        }
コード例 #8
0
ファイル: DisposalBin.cs プロジェクト: AlexTheM8/unitystation
        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());
        }