31 lines
788 B
C#
31 lines
788 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Cysharp.Threading.Tasks;
|
|
using Project.B.Entities;
|
|
using Project.B.Map;
|
|
using UnityEngine;
|
|
|
|
namespace Net.Like.Xue.Tokyo.GameService
|
|
{
|
|
public class GameSpawnPlayerService
|
|
{
|
|
private readonly IGameMapService _gameMapService;
|
|
private readonly IPlayerFactory _playerFactory;
|
|
|
|
public GameSpawnPlayerService(IGameMapService gameMapService, IPlayerFactory playerFactory)
|
|
{
|
|
_gameMapService = gameMapService;
|
|
_playerFactory = playerFactory;
|
|
|
|
_gameMapService.OnMapChanged += OnMapChanged;
|
|
}
|
|
|
|
private void OnMapChanged(Guid arg1, string arg2)
|
|
{
|
|
_playerFactory.CreateAsync(null).Forget();
|
|
}
|
|
}
|
|
|
|
}
|