DoContainerHeader









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

Featured Snippets


File name: PhotonGUI.cs Copy
152     public static void ContainerHeader( string headline )
153     {
154         DoContainerHeader( headline, 27, 0 );
155     }
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
162     public static bool ContainerHeaderFoldout( string headline, bool foldout )
163     {
164         return DoContainerHeaderFoldout( headline, foldout );
165     }
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     }
File name: PhotonGUI.cs Copy
254     static bool DoContainerHeaderFoldout( string headline, bool foldout )
255     {
256         Rect rect = DoContainerHeader( "", 27, 0f );
257         Rect foldoutRect = new Rect( rect.xMin + 15, rect.yMin + 5, rect.width, rect.height );
258
259         return EditorGUI.Foldout( foldoutRect, foldout, headline, FoldoutBold );
260     }
File name: PhotonGUI.cs Copy
262     static Rect DoContainerHeader( string headline, float height, float contentOffset )
263     {
264         GUILayout.Space( 5 );
265         Rect controlRect = EditorGUILayout.GetControlRect( false, height );
266
267         int controlID = GUIUtility.GetControlID( FocusType.Passive, controlRect );
268
269         if( Event.current.type == EventType.Repaint )
270         {
271             PhotonGUI.DefaultTitleStyle.Draw( controlRect, GUIContent.none, controlID );
272
273             Rect labelRect = new Rect( controlRect.xMin + 5 + contentOffset, controlRect.yMin + 5, controlRect.width, controlRect.height );
274             GUI.Label( labelRect, headline, EditorStyles.boldLabel );
275         }
276
277         return controlRect;
278     }

DoContainerHeader 92 lượt xem

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