コード例 #1
0
        private static void AppendActorCreationMessage(INetworkMessageOut message, INetworkedActor localActor)
        {
            var actorLocation = localActor.GetLocation();

            message.Write(localActor.Id);
            message.Write(actorLocation.X);
            message.Write(actorLocation.Y);
            message.Write(CompatibilityManager.GetHashCode(localActor.GetType().Name));

            if (localActor.ReplicateProperties)
            {
                localActor.Serialize(message);
            }
        }
コード例 #2
0
 /// <summary>
 /// Remove a remote player from the game.
 /// </summary>
 /// <param name="player"></param>
 protected abstract void RemoveRemotePlayer(INetworkedActor player);
コード例 #3
0
        public override void CreateActor(INetworkedActor actor)
        {
            Actors.Add(actor);

            _actorsToCreate.Add(actor);
        }
コード例 #4
0
        public override void DestroyActor(INetworkedActor actor)
        {
            actor.IsMarkedToDestroy = true;

            _actorsToDestroy.Add(actor.Id);
        }
コード例 #5
0
 public void DestroyActor(INetworkedActor actor)
 {
     _networkPeer?.DestroyActor(actor);
 }
コード例 #6
0
 public void CreateActor(INetworkedActor actor)
 {
     _networkPeer?.CreateActor(actor);
 }
コード例 #7
0
 /// <summary>
 /// Remove a remote player from the game.
 /// </summary>
 /// <param name="player"></param>
 protected override void RemoveRemotePlayer(INetworkedActor player)
 {
     // do nothing in this example
 }
コード例 #8
0
 public virtual void DestroyActor(INetworkedActor actor)
 {
 }
コード例 #9
0
 public virtual void CreateActor(INetworkedActor actor)
 {
 }