Exemple #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();
        }
Exemple #2
0
 /// <Summary>
 /// Set traverse data of the floor.
 /// </Summary>
 void SetTraverse()
 {
     TraverseManager.InitializeTraverseData();
     TraverseManager.AddDungeonTraverseData(dungeonData.dungeonId, floorMapData.floorId, floorMapData);
     PlayerPosition.SetTraverseData();
 }