示例#1
0
        public void ManualSpawnTest()
        {
            bool invokeAddPlayerMessage = false;

            server.LocalPlayer.RegisterHandler <AddCharacterMessage>(msg => invokeAddPlayerMessage = true);

            spawner.RequestServerSpawnPlayer();

            Assert.That(invokeAddPlayerMessage, Is.False);
        }
示例#2
0
        public IEnumerator ManualSpawnTest() => UniTask.ToCoroutine(async() =>
        {
            var invokeAddPlayerMessage = false;
            ServerMessageHandler.RegisterHandler <AddCharacterMessage>(msg => invokeAddPlayerMessage = true);

            spawner.RequestServerSpawnPlayer();

            // wait for messages to be processed
            await UniTask.Yield();

            Assert.That(invokeAddPlayerMessage, Is.True);
        });