예제 #1
0
        /// <Summary>
        /// Move position event process.
        /// </Summary>
        /// <param name="eventParts">Event parts data.</param>
        IEnumerator EventMovePosition(AriadneEventParts eventParts)
        {
            // Fade out
            fadeManager.FadeOut();
            var waitTime = new WaitForSeconds(fadeManager.fadeTime);

            yield return(waitTime);

            // Set new position
            if (eventParts.destDungeon == null)
            {
                Debug.LogError("Dest dungeon is not assigned to this EventData!");
                yield break;
            }
            if (eventParts.destMap == null)
            {
                Debug.LogError("Dest map is not assigned to this EventData!");
                yield break;
            }

            // Send dungeon data to DungeonSetting.
            moveDestDungeon = eventParts.destDungeon;
            SendDungeonData(gameController);

            PlayerPosition.currentDungeonId = eventParts.destDungeon.dungeonId;
            PlayerPosition.currentFloorId   = eventParts.destMap.floorId;
            PlayerPosition.playerPos        = eventParts.destPos;
            PlayerPosition.direction        = eventParts.direction;

            // Get new floor data
            DungeonSettings ds = gameController.GetComponent <DungeonSettings>();

            dungeonData  = ds.dungeonData;
            floorMapData = ds.GetCurrentFloorData();

            // Add traverse data
            TraverseManager.AddDungeonTraverseData(PlayerPosition.currentDungeonId, PlayerPosition.currentFloorId, floorMapData);
            PlayerPosition.SetTraverseData();
            yield return(waitTime);

            // Remove dungeon walls and redraw dungeon
            SendRedrawMessage(gameController);

            // Move camera
            SetCameraPos();
            float targetAngle = CurrentDirAngle();

            player.transform.eulerAngles = new Vector3(0, targetAngle, 0);
            SendSetNewMap();
            SendSetDirtyMsg();

            yield return(waitTime);

            // Fade in
            fadeManager.FadeIn();
            yield return(waitTime);

            OnPostEvent();
        }
예제 #2
0
 /// <Summary>
 /// Get floor data from the DungeonSettings component.
 /// </Summary>
 void GetFloorData()
 {
     if (gameController == null)
     {
         gameController = GameObject.FindGameObjectWithTag("GameController");
     }
     if (dungeonSettings == null)
     {
         dungeonSettings = gameController.GetComponent <DungeonSettings>();
     }
     floorMapData = dungeonSettings.GetCurrentFloorData();
 }
예제 #3
0
        void GetSettings()
        {
            gameController = GameObject.FindGameObjectWithTag("GameController");
            DungeonSettings ds = gameController.GetComponent <DungeonSettings>();

            dungeonData  = ds.dungeonData;
            floorMapData = ds.GetCurrentFloorData();
            dungeonParts = floorMapData.dungeonParts;
            if (dungeonParts == null)
            {
                DungeonPartsManager.GetDefaultDungeonParts();
            }

            player = GameObject.FindGameObjectWithTag("Player");
        }
예제 #4
0
        /// <Summary>
        /// Get settings such as dungeon data from DungeonSettings class.
        /// </Summary>
        protected void GetSettings()
        {
            gameController = GameObject.FindGameObjectWithTag("GameController");
            DungeonSettings ds = gameController.GetComponent <DungeonSettings>();

            dungeonData         = ds.dungeonData;
            currentFloorMapData = ds.GetCurrentFloorData();
            dungeonParts        = currentFloorMapData.dungeonParts;
            if (dungeonParts == null)
            {
                DungeonPartsManager.GetDefaultDungeonParts();
            }
            isDrawOutsideWall = ds.isDrawOutsideWall;
            outsideWallSize   = ds.outsideWallSize;
        }