์ฌ๊ธฐ ๋ณต๋ถํ๋ฉด ์ ์์ผ๋ก ๋ณด์ด๋๋ฐ ์ค์ ๋ก ๊ธ ์ฌ๋ฆฌ๋ฉด ๋ค์ฌ์ฐ๊ธฐ๊ฐ ๋ค ์์ด์ง๋ค
์ฝ๋ ์ฌ๋ฆฌ๋ ์ธ๋ถ์ด๋ค์ ์ด์ผ ํ๋๊ฑฐ์
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | using Godot; using System; namespace Godot { private static Node FindChildNodeOfTypeRecursive(Node node, Type type) { if (node.GetType() == type) { return node; } else if (node.GetChildCount() > 0) { foreach (Node child in node.GetChildren()) { Node rv = FindChildNodeOfTypeRecursive(child, type); if (rv != null) return rv; } } return null; } public static T GetChildOfType<T>(this Node node) where T : Node { Type type = typeof(T); return FindChildNodeOfTypeRecursive(node, type) as T; } } } | cs |
https://colorscripter.com/
- dc App
๋ ์ ๋ญ๊ฐ ํํธ๊ฐ ์๋ง์ง... ์จ๋ ใณใณ