ContainerHeaderToggle









How do I use Container Header Toggle
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: PhotonTransformViewEditor.cs Copy
401     private void DrawHeader(string label, SerializedProperty property)
402     {
403         if (property == null)
404         {
405             return;
406         }
407
408         bool newValue = PhotonGUI.ContainerHeaderToggle(label, property.boolValue);
409
410         if (newValue != property.boolValue)
411         {
412             Undo.RecordObject(this.m_Target, "Change " + label);
413             property.boolValue = newValue;
414             EditorUtility.SetDirty(this.m_Target);
415         }
416     }
File name: PhotonGUI.cs Copy
157     public static bool ContainerHeaderToggle( string headline, bool toggle )
158     {
159         return DoContainerHeaderToggle( headline, toggle );
160     }
File name: PhotonGUI.cs Copy
245     static bool DoContainerHeaderToggle( string headline, bool toggle )
246     {
247         Rect rect = DoContainerHeader( headline, 27, 15 );
248         Rect toggleRect = new Rect( rect.xMin + 5, rect.yMin + 5, EditorGUIUtility.labelWidth, rect.height );
249
250         return EditorGUI.Toggle( toggleRect, toggle );
251     }

ContainerHeaderToggle 89 lượt xem

Gõ tìm kiếm nhanh...