Skip to content

Commit 77b3f8a

Browse files
committed
feat(Util): Revert get component above/below/all
1 parent e5ee904 commit 77b3f8a

File tree

3 files changed

+0
-85
lines changed

3 files changed

+0
-85
lines changed

Assets/JCSUnity/Scripts/Util/JCS_Util.cs

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -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>

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
1414
* fix(Util): Add to data path ([`e117a0a`](../../commits/e117a0a32e0fa7cb99fac9e12712daae55c832da))
1515
* chore(Util): Add shuffle to collection ([`f43030d`](../../commits/f43030d1a1021da2e83bf346737b0c63c992c348))
1616
* feat(Util): Add enum module ([`e05d063`](../../commits/e05d063c05fbb385cc5c6bbb89d17e2258c05660))
17-
* feat(Util): Add get component(s) above/below/all ([`7f753db`](../../commits/7f753db4d079536b2e8f9a52543a949af27f7631))
1817

1918
## 4.1.1
2019
> Released Oct 11, 2025

docs/ScriptReference/Util/JCS_Util.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ All code utility is stored here.
1919
| Parse | Parse `str` to float, return `defaultValue` if failed. |
2020
| Parse | Parse `str` to boolean, return `defaultValue` if failed. |
2121
| ToJson | Serialize object to JSON string. |
22-
| GetComponentAbove | Get the component from current and above layers. |
23-
| GetComponentBelow | Get the component from current and below layers. |
24-
| GetComponentAll | Get the component from all layers. |
25-
| GetComponentsAbove | Get components from current and above layers. |
26-
| GetComponentsBelow | Get components from current and below layers. |
27-
| GetComponentsAll | Get components from all layers. |
2822
| EnableComponent | Do enable/distance component. |
2923
| EnableComponents | Set enable/disable to all component on this transform. |
3024
| SetActiveToAllChildren | Active all the child in a transform. |

0 commit comments

Comments
 (0)