Ejemplo n.º 1
0
        public void Remove()
        {
#if CLIENT
            if (loopingSoundChannel != null)
            {
                loopingSoundChannel.Dispose();
                loopingSoundChannel = null;
            }
            if (GuiFrame != null)
            {
                GUI.RemoveFromUpdateList(GuiFrame, true);
            }
#endif

            if (delayedCorrectionCoroutine != null)
            {
                CoroutineManager.StopCoroutines(delayedCorrectionCoroutine);
                delayedCorrectionCoroutine = null;
            }

            if (AITarget != null)
            {
                AITarget.Remove();
                AITarget = null;
            }

            RemoveComponentSpecific();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Remove the component so that it doesn't appear to exist in the game world (stop sounds, remove bodies etc)
        /// but don't reset anything that's required for cloning the item
        /// </summary>
        public void ShallowRemove()
        {
#if CLIENT
            if (loopingSoundChannel != null)
            {
                loopingSoundChannel.Dispose();
                loopingSoundChannel = null;
            }
#endif
            if (AITarget != null)
            {
                AITarget.Remove();
                AITarget = null;
            }

            ShallowRemoveComponentSpecific();
        }