public UpdateTransformMessage(NetworkInstanceId id, Vector3 position, Quaternion rotation, Vector3 childPosition, Quaternion childRotation, Vector3 velocity) { this.type = UpdateTransform; objectId = id; relayPosition = position.GetSerializableVector(); relayRotation = rotation.GetSerializableVector(); childRelayPosition = childPosition.GetSerializableVector(); childRelayRotation = childRotation.GetSerializableVector(); relayVelocity = velocity.GetSerializableVector(); }
public SpawnCommand(int ownerId, NetworkInstanceId id, string name, NetworkSyncVector3 position, NetworkSyncQuaternion rotation, NetworkSyncVarValue syncVarValues, NetworkSpawnArgs args) { this.id = id; this.ownerId = ownerId; this.name = name; this.position = position; this.rotation = rotation; this.syncVarValues = syncVarValues; this.arguments = args; }
private void Update() { _position = transform.position.GetSerializableVector(); _rotation = transform.rotation.GetSerializableVector(); if (ServerStage.active) { foreach (SyncVar var in syncVarDictionary.Values) { if (var.IsChanged()) { SendVariableUpdate(var); var.Equalize(); } } } }
private void Awake() { _position = transform.position.GetSerializableVector(); _rotation = transform.rotation.GetSerializableVector(); }