示例#1
0
            public void Execute([ReadOnly] ref Player player)
            {
                //Debug.LogWarning($"AllPlayer2EnterGameClientJob  enterGamePlayerEntitys.Length={enterGamePlayerEntitys.Length}  to playerEntity={playerEntity.Index}");
                for (int i = 0; i < enterGamePlayerEntitys.Length; ++i)
                {
                    var enterGamePlayerEntity = enterGamePlayerEntitys[i];
                    var outBuffer             = enterGameOutBuffers[enterGamePlayerEntity];

                    //
                    //Debug.LogWarning($"AllPlayer2EnterGameClientJob  player.id={player.id}");
                    var s = new PlayerCreateSerialize {
                        value = player.id
                    };
                    s._DoSerialize(outBuffer);
                }
            }
示例#2
0
            public void Execute(Entity playerEntity, int index, DynamicBuffer <NetworkReliableOutBuffer> outBuffer)
            {
                //排除刚进入游戏的playerEntity
                for (int i = 0; i < enterGamePlayerEntitys.Length; ++i)
                {
                    if (playerEntity == enterGamePlayerEntitys[i])
                    {
                        return;
                    }
                }

                for (int i = 0; i < enterGamePlayerEntitys.Length; ++i)
                {
                    //Debug.LogWarning($"EnterGamePlayer2AllClientsJob  enterGamePlayers[i].id={enterGamePlayers[i].id}");
                    var s = new PlayerCreateSerialize {
                        value = enterGamePlayers[i].id
                    };
                    s._DoSerialize(outBuffer);
                }
            }