internal void OnGuiInternal() { if (m_PreviewTexture == null) { return; } EditorGUILayout.LabelField(m_HeaderLabel, EditorStyles.whiteLargeLabel); var newDeadZone = Mathf.Clamp(EditorGUILayout.FloatField("dead zone", m_RatingConfig.deadZone), 0f, 0.98f); var newCenter = Mathf.Clamp01(EditorGUILayout.FloatField("center", m_RatingConfig.center)); if (newDeadZone != m_PreviousDeadZone || newCenter != m_PreviousCenter) { m_RatingConfig = new RatingConfiguration(newDeadZone, newCenter); m_Condition.ratingConfig = m_RatingConfig; DrawTexture(); } var rect = EditorGUILayout.GetControlRect(false, m_TextureSize.y, GUILayout.Width(m_TextureSize.x)); EditorGUI.DrawPreviewTexture(rect, m_PreviewTexture); if (rect.Contains(Event.current.mousePosition)) { EditorGUIUtils.MouseLabel(GetMouseLabel()); } m_PreviousDeadZone = m_RatingConfig.deadZone; m_PreviousCenter = m_RatingConfig.center; }