Exemple #1
0
        /// <summary>
        ///     Removes a teleportable from the portal area
        /// </summary>
        /// <param name="teleportable">teleportable to remove</param>
        private void RemoveTeleportable(Teleportable teleportable)
        {
            if (!teleportable || teleportable.RemovedLastFrame)
            {
                return;
            }
            if (!NearTeleportables.Contains(teleportable))
            {
                return;
            }
            teleportable.RemovedLastFrame = true;

            if (!NonObliqueOverride)
            {
                teleportable.SetClipPlane(Vector3.zero, Vector3.zero, Vector3.zero, Vector3.zero);
            }


            NearTeleportables.Remove(teleportable);
            UpdateDopplegangers();

            if (NearTeleportables.Count < 1)
            {
                SetBufferWallActive(false);
            }

            teleportable.LeavePortal(this);

            teleportable.CollisionManager.ResumeCollisionsForKey(this);

            if (teleportable == GlobalPortalSettings.PlayerTeleportable)
            {
                _headInPortalTrigger = false;
            }
        }
Exemple #2
0
        /// <summary>
        /// Removes a teleportable from the portal area
        /// </summary>
        /// <param name="teleportScript">teleportable to remove</param>
        private void RemoveTeleportable(Teleportable teleportScript)
        {
            if (!teleportScript || !NearTeleportables.Contains(teleportScript))
            {
                return;
            }
            if (teleportScript.RemovedLastFrame)
            {
                return;
            }
            teleportScript.RemovedLastFrame = true;
            if (!NonObliqueOverride)
            {
                teleportScript.SetClipPlane(Vector3.zero, Vector3.zero, teleportScript.Renderers.Keys);
                teleportScript.SetClipPlane(Vector3.zero, Vector3.zero, teleportScript.Renderers.Values);
            }

            UpdateDopplegangers();
            NearTeleportables.Remove(teleportScript);

            if (NearTeleportables.Count < 1)
            {
                SetBufferWallActive(false);
            }

            teleportScript.LeavePortal();
            //teleportScript.ResetDoppleganger();
            teleportScript.ResumeAllCollision(this);
        }