@@ -290,84 +290,6 @@ public static string ToJson<T>(T obj)
290290
291291 #region Component
292292
293- /// <summary>
294- /// Get the component from current and above layers.
295- /// </summary>
296- public static T GetComponentAbove < T > ( this Component comp )
297- {
298- T result = comp . GetComponent < T > ( ) ;
299-
300- if ( result != null )
301- return result ;
302-
303- return comp . GetComponentInParent < T > ( ) ;
304- }
305-
306- /// <summary>
307- /// Get the component from current and below layers.
308- /// </summary>
309- public static T GetComponentBelow < T > ( this Component comp )
310- {
311- T result = comp . GetComponent < T > ( ) ;
312-
313- if ( result != null )
314- return result ;
315-
316- return comp . GetComponentInChildren < T > ( ) ;
317- }
318-
319- /// <summary>
320- /// Get the component from all layers.
321- /// </summary>
322- public static T GetComponentAll < T > ( this Component comp )
323- {
324- T result = comp . GetComponentAbove < T > ( ) ;
325-
326- if ( result != null )
327- return result ;
328-
329- return comp . GetComponentBelow < T > ( ) ;
330- }
331-
332- /// <summary>
333- /// Get components from current and above layers.
334- /// </summary>
335- public static T [ ] GetComponentsAbove < T > ( this Component comp )
336- {
337- T [ ] result = comp . GetComponents < T > ( ) ;
338-
339- if ( result != null )
340- return result ;
341-
342- return comp . GetComponentsInParent < T > ( ) ;
343- }
344-
345- /// <summary>
346- /// Get components from current and below layers.
347- /// </summary>
348- public static T [ ] GetComponentsBelow < T > ( this Component comp )
349- {
350- T [ ] result = comp . GetComponents < T > ( ) ;
351-
352- if ( result != null )
353- return result ;
354-
355- return comp . GetComponentsInChildren < T > ( ) ;
356- }
357-
358- /// <summary>
359- /// Get components from all layers.
360- /// </summary>
361- public static T [ ] GetComponentsAll < T > ( this Component comp )
362- {
363- T [ ] result = comp . GetComponentsAbove < T > ( ) ;
364-
365- if ( result != null )
366- return result ;
367-
368- return comp . GetComponentsBelow < T > ( ) ;
369- }
370-
371293 /// <summary>
372294 /// Do enable/distance component.
373295 /// </summary>
0 commit comments