diff --git a/Mirror/Editor/Mirror.Editor.csproj b/Mirror/Editor/Mirror.Editor.csproj index 1e66c2157..2ff7da645 100644 --- a/Mirror/Editor/Mirror.Editor.csproj +++ b/Mirror/Editor/Mirror.Editor.csproj @@ -62,7 +62,6 @@ - diff --git a/Mirror/Editor/NetworkTransformPreview.cs b/Mirror/Editor/NetworkTransformPreview.cs deleted file mode 100644 index f8b696320..000000000 --- a/Mirror/Editor/NetworkTransformPreview.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using UnityEditor; -using UnityEngine; -using UnityObject = UnityEngine.Object; - -namespace Mirror -{ - [CustomPreview(typeof(GameObject))] - class NetworkTransformPreview : ObjectPreview - { - NetworkTransform m_Transform; - Rigidbody m_Rigidbody3D; - Rigidbody2D m_Rigidbody2D; - - GUIContent m_Title; - - public override void Initialize(UnityObject[] targets) - { - base.Initialize(targets); - GetNetworkInformation(target as GameObject); - } - - public override GUIContent GetPreviewTitle() - { - m_Title = m_Title ?? new GUIContent("Network Transform"); - return m_Title; - } - - public override bool HasPreviewGUI() - { - return m_Transform != null; - } - - public override void OnPreviewGUI(Rect r, GUIStyle background) - { - if (Event.current.type != EventType.Repaint) - return; - - if (m_Transform == null) - return; - - const int padding = 4; - int posY = 4; - - float posDiff = (m_Transform.transform.position - m_Transform.targetSyncPosition).magnitude; - GUI.Label(new Rect(r.xMin + padding, r.y + posY, 600, 20), "Position: " + m_Transform.transform.position + " Target: " + m_Transform.targetSyncPosition + " Diff: " + posDiff); - posY += 20; - - if (m_Rigidbody3D != null) - { - float angleDiff3D = Quaternion.Angle(m_Transform.rigidbody3D.rotation, m_Transform.targetSyncRotation3D); - GUI.Label(new Rect(r.xMin + padding, r.y + posY, 600, 20), "Angle: " + m_Transform.rigidbody3D.rotation + " Target: " + m_Transform.targetSyncRotation3D + " Diff: " + angleDiff3D); - posY += 20; - - GUI.Label(new Rect(r.xMin + padding, r.y + posY, 600, 20), "Velocity: " + m_Transform.rigidbody3D.velocity + " Target: " + m_Transform.targetSyncVelocity); - posY += 20; - } - - if (m_Rigidbody2D != null) - { - float angleDiff2D = m_Transform.rigidbody2D.rotation - m_Transform.targetSyncRotation2D; - GUI.Label(new Rect(r.xMin + padding, r.y + posY, 600, 20), "Angle: " + m_Transform.rigidbody2D.rotation + " Target: " + m_Transform.targetSyncRotation2D + " Diff: " + angleDiff2D); - posY += 20; - - GUI.Label(new Rect(r.xMin + padding, r.y + posY, 600, 20), "Velocity: " + m_Transform.rigidbody2D.velocity + " Target: " + m_Transform.targetSyncVelocity); - posY += 20; - } - - GUI.Label(new Rect(r.xMin + padding, r.y + posY, 200, 20), "Last SyncTime: " + (Time.time - m_Transform.lastSyncTime)); - } - - void GetNetworkInformation(GameObject gameObject) - { - m_Transform = gameObject.GetComponent(); - - m_Rigidbody3D = gameObject.GetComponent(); - m_Rigidbody2D = gameObject.GetComponent(); - } - } -}