Beispiel #1
0
    protected override void Awake()
    {
        base.Awake();

        CustomResolver.Register(GeneratedResolver.Instance);

        _client = GetComponent <NetClientP2pBehaviour>();
        _client.SetClientOptionFunc = (clientOption) =>
        {
        };
    }
Beispiel #2
0
    protected override void Awake()
    {
        base.Awake();

        _client = GetComponent <NetClientP2pBehaviour>();

        Client.OnConnected      = OnConnected;
        Client.OnClosed         = OnClosed;
        Client.OnReceived       = OnReceive;
        Client.OnP2pGroupLeaved = OnP2pGroupLeave;

        // 릴레이 테스트를 위한 옵션
        //_client.Client.ClientOption.IsForceRelay = true;

        // 자동으로 생성된 Rpc 서비스를 사용하기 위해 등록함
        Client.AddRpcService(new ActorViewRpcServiceView());
        Client.AddRpcService(new ActorScaleRpcServiceView());

        CustomResolver.Register(GeneratedResolver.Instance);
    }