diff --git a/Assets/Mirror/Components/NetworkTransformBase.cs b/Assets/Mirror/Components/NetworkTransformBase.cs index 6ab87ad95..badaff019 100644 --- a/Assets/Mirror/Components/NetworkTransformBase.cs +++ b/Assets/Mirror/Components/NetworkTransformBase.cs @@ -22,16 +22,6 @@ namespace Mirror { public abstract class NetworkTransformBase : NetworkBehaviour { - // rotation compression. not public so that other scripts can't modify - // it at runtime. alternatively we could send 1 extra byte for the mode - // each time so clients know how to decompress, but the whole point was - // to save bandwidth in the first place. - // -> can still be modified in the Inspector while the game is running, - // but would cause errors immediately and be pretty obvious. - [Tooltip("Compresses 16 Byte Quaternion into None=12, Much=3, Lots=2 Byte")] - [SerializeField] Compression compressRotation = Compression.Much; - public enum Compression { None, Much, Lots, NoRotation }; // easily understandable and funny - [Tooltip("Set to true if moves come from owner client, set to false if moves always come from server")] public bool clientAuthority; @@ -49,6 +39,20 @@ public enum Compression { None, Much, Lots, NoRotation }; // easily understandab [Tooltip("Changes to the transform must exceed these values to be transmitted on the network.")] public float localScaleSensitivity = .01f; + // rotation compression. not public so that other scripts can't modify + // it at runtime. alternatively we could send 1 extra byte for the mode + // each time so clients know how to decompress, but the whole point was + // to save bandwidth in the first place. + // -> can still be modified in the Inspector while the game is running, + // but would cause errors immediately and be pretty obvious. + [Header("Compression")] + [Tooltip("Compresses 16 Byte Quaternion into None=12, Much=3, Lots=2 Byte")] + [SerializeField] Compression compressRotation = Compression.Much; + public enum Compression { None, Much, Lots, NoRotation }; // easily understandable and funny + + // target transform to sync. can be on a child. + protected abstract Transform targetComponent { get; } + // server Vector3 lastPosition; Quaternion lastRotation; @@ -71,9 +75,6 @@ public class DataPoint // local authority send time float lastClientSendTime; - // target transform to sync. can be on a child. - protected abstract Transform targetComponent { get; } - // serialization is needed by OnSerialize and by manual sending from authority static void SerializeIntoWriter(NetworkWriter writer, Vector3 position, Quaternion rotation, Compression compressRotation, Vector3 scale) { diff --git a/Assets/Mirror/Components/NetworkTransformChild.cs b/Assets/Mirror/Components/NetworkTransformChild.cs index 84e8b0507..84a0d31db 100644 --- a/Assets/Mirror/Components/NetworkTransformChild.cs +++ b/Assets/Mirror/Components/NetworkTransformChild.cs @@ -10,7 +10,9 @@ namespace Mirror [HelpURL("https://mirror-networking.com/docs/Components/NetworkTransformChild.html")] public class NetworkTransformChild : NetworkTransformBase { + [Header("Target")] public Transform target; + protected override Transform targetComponent => target; } }