This repository has been archived on 2025-06-25. You can view files and clone it, but cannot push or open issues or pull requests.
Net.Like.Xue.Tokyo/Assets/Artists/Scripts/GameService/GameSpawnPlayerService.cs

31 lines
793 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,null).Forget();
}
}
}