using UnityEngine.Networking;
namespace Cyber.Networking.Messages {
///
/// Includes information about interacting an interactible. Applicable only for some interactibles.
///
public class InteractionPkt : MessageBase {
///
/// ID of the interactible.
///
public int InteractSyncBaseID;
///
/// Id of the interactor.
///
public int OwnerSyncBaseID;
///
/// Creates an InteraktionPkt, which contains the message "someone interacted".
///
/// The Sync Base ID of the interacted thing.
public InteractionPkt(int syncBaseID) {
InteractSyncBaseID = syncBaseID;
}
///
/// Empty constructor for deserialization.
///
public InteractionPkt() {}
///
/// Deserializes SyncBaseID for the recipent.
///
///
public override void Deserialize(NetworkReader reader) {
InteractSyncBaseID = reader.ReadInt32();
OwnerSyncBaseID = reader.ReadInt32();
}
///
/// Serializes the SyncBaseID for sending.
///
///
public override void Serialize(NetworkWriter writer) {
writer.Write(InteractSyncBaseID);
writer.Write(OwnerSyncBaseID);
}
}
}