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); } }
/// <summary> /// Remove a remote player from the game. /// </summary> /// <param name="player"></param> protected abstract void RemoveRemotePlayer(INetworkedActor player);
public override void CreateActor(INetworkedActor actor) { Actors.Add(actor); _actorsToCreate.Add(actor); }
public override void DestroyActor(INetworkedActor actor) { actor.IsMarkedToDestroy = true; _actorsToDestroy.Add(actor.Id); }
public void DestroyActor(INetworkedActor actor) { _networkPeer?.DestroyActor(actor); }
public void CreateActor(INetworkedActor actor) { _networkPeer?.CreateActor(actor); }
/// <summary> /// Remove a remote player from the game. /// </summary> /// <param name="player"></param> protected override void RemoveRemotePlayer(INetworkedActor player) { // do nothing in this example }
public virtual void DestroyActor(INetworkedActor actor) { }
public virtual void CreateActor(INetworkedActor actor) { }