33 lines
752 B
C#
33 lines
752 B
C#
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using BITFALL.Services;
|
||
|
using BITKit;
|
||
|
using BITKit.HttpNet;
|
||
|
using BITKit.SubSystems;
|
||
|
using Net.Client;
|
||
|
using Net.Server;
|
||
|
using Net.Share;
|
||
|
using UnityEngine;
|
||
|
using Cysharp.Threading.Tasks;
|
||
|
|
||
|
namespace BITFALL
|
||
|
{
|
||
|
public class UnityPlayerService : MonoBehaviour, IPlayerService
|
||
|
{
|
||
|
public event Action<int> OnPlayerReady;
|
||
|
[SerializeField, SerializeReference, SubclassSelector]
|
||
|
private INetProvider netProvider;
|
||
|
|
||
|
private void Start()
|
||
|
{
|
||
|
netProvider.AddRpcHandle(this);
|
||
|
BITNet.OnConnected += OnConnect;
|
||
|
}
|
||
|
private void OnConnect()
|
||
|
{
|
||
|
OnPlayerReady?.Invoke(0);
|
||
|
}
|
||
|
}
|
||
|
}
|