Exemple #1
0
        private void SetupTeleported()
        {
            var      tpList = TeleportManager.GetTeleportList(ChunkNumber);
            GameUnit unit   = null;

            foreach (var npcName in tpList)
            {
                var pos2Int = GetFreePos();
                var pos3Int = new Vector3Int(pos2Int.x, pos2Int.y, 1);
                if (npcName.Contains("npc"))
                {
                    unit = SetupUnit(npcName, pos3Int, PlayersManager.GetMyPlayer());
                }
                else if (npcName.Contains("item") || npcName.Contains("building"))
                {
                    SetupItem(npcName, pos3Int, PlayersManager.GetMyPlayer());
                }
            }

            if (unit != null)
            {
                CameraMove.SetCameraAt(new Vector2Int(unit.CurrentPos.x, unit.CurrentPos.y));
            }
            TeleportManager.SetTeleported(ChunkNumber);
        }