예제 #1
0
        /// <summary>
        /// Player is leaving dungeon, transition them back outside.
        /// </summary>
        public void TransitionDungeonExterior(bool doFade = false)
        {
            if (!ReferenceComponents() || !dungeon || !isPlayerInsideDungeon)
                return;

            // Raise event
            RaiseOnPreTransitionEvent(TransitionType.ToDungeonExterior);

            EnableExteriorParent();

            // Set player outside exterior door position and set facing
            //transform.position = dungeonEntrancePosition;
            //SetFacing(-dungeonEntranceForward);
            //SetStanding();

            // Player is now outside dungeon
            isPlayerInside = false;
            isPlayerInsideDungeon = false;
            isPlayerInsideDungeonPalace = false;
            lastPlayerDungeonBlockIndex = -1;
            playerDungeonBlockData = new DFLocation.DungeonBlock();

            // Position player to door
            world.SetAutoReposition(StreamingWorld.RepositionMethods.DungeonEntrance, Vector3.zero);

            // Raise event
            RaiseOnTransitionDungeonExteriorEvent();

            // Fade in from black
            if (doFade)
                DaggerfallUI.Instance.FadeHUDFromBlack();
        }
        public bool GetBlockData(int index, out DFLocation.DungeonBlock blockDataOut)
        {
            if (!summary.LocationData.Loaded)
            {
                blockDataOut = new DFLocation.DungeonBlock();
                return false;
            }

            blockDataOut = summary.LocationData.Dungeon.Blocks[index];

            return true;
        }
        /// <summary>
        /// Player is leaving dungeon, transition them back outside.
        /// </summary>
        public void TransitionDungeonExterior()
        {
            if (!ReferenceComponents() || !dungeon || !isPlayerInsideDungeon)
                return;

            // Raise event
            RaiseOnPreTransitionEvent(TransitionType.ToDungeonExterior);

            // Enable exterior parent
            if (ExteriorParent != null)
                ExteriorParent.SetActive(true);

            // Disable dungeon parent
            if (DungeonParent != null)
                DungeonParent.SetActive(false);

            // Destroy dungeon game object
            Destroy(dungeon.gameObject);
            dungeon = null;

            // Set player outside exterior door position and set facing
            transform.position = dungeonEntrancePosition;
            SetFacing(-dungeonEntranceForward);
            SetStanding();

            // Player is now outside dungeon
            isPlayerInside = false;
            isPlayerInsideDungeon = false;
            isPlayerInsideDungeonPalace = false;
            lastPlayerDungeonBlockIndex = -1;
            playerDungeonBlockData = new DFLocation.DungeonBlock();

            // Raise event
            RaiseOnTransitionDungeonExteriorEvent();
        }