public void NotifyPlayers() { // Logger.LogFormat( "{0} Notified: {1}", Category.Transform, gameObject.name, serverState.WorldPosition ); SyncMatrix(); serverState.IsLocalRotation = false; TransformStateMessage.SendToAll(gameObject, serverState); }
public void NotifyPlayers() { // Debug.Log( $"{gameObject.name} Notified" ); SyncMatrix(); serverState.IsLocalRotation = false; TransformStateMessage.SendToAll(gameObject, serverState); }
/// <summary> /// Send the TransformStateMessage to a all client. /// </summary> /// <param name="transformedObject">The object to apply the transformation</param> /// <param name="state">The transformation to apply</param> /// <param name="forced"> /// Used for client simulation, use false if already updated by prediction /// (to avoid updating it twice) /// </param> /// <returns>The sent message</returns> public static TransformStateMessage SendToAll(GameObject transformedObject, TransformState state, bool forced = true) { var msg = new TransformStateMessage { TransformedObject = transformedObject != null?transformedObject.GetComponent <NetworkIdentity>().netId : NetId.Invalid, State = state, ForceRefresh = forced }; msg.SendToAll(); return(msg); }
private void NotifyPlayers() { TransformStateMessage.SendToAll(gameObject, serverTransformState); }