Example #1
0
    public void AddPlayer(int id, Health health, ChannelManager cm)
    {
        lock (this) {
            //TODO Whathappens if many discconect and reconnect
            var channel = new OtherPlayersChannel(
                new OtherPlayersStatesBridge(id),
                new TrivialStrategy(),
                0.1f);

            playersChannel[id] = channel;
            Healths[id]        = health;
            Debug.Log("Players connected  " + Healths.Count);

            cm.RegisterChannel((int)RegisteredChannels.OtherPlayersChannel, channel);
            channel.StartSending();
        }
    }
Example #2
0
 private void Start()
 {
     _channel = new OtherPlayersChannel(null, new TrivialStrategy(), 0.1f);
     ClientConnectionManager.Instance.ChannelManager.RegisterChannel((int)RegisteredChannels.OtherPlayersChannel, _channel);
     _channel.Interpolator.StartInterpolating();
 }