MCPcopy Index your code
hub / github.com/g3n/engine / FindLoaderID

Method FindLoaderID

core/node.go:284–301  ·  view source on GitHub ↗

FindLoaderID looks in the specified node and in all its children for a node with the specified loaderID and if found returns it. Returns nil if not found.

(id string)

Source from the content-addressed store, hash-verified

282// for a node with the specified loaderID and if found returns it.
283// Returns nil if not found.
284func (n *Node) FindLoaderID(id string) INode {
285
286 var finder func(parent INode, id string) INode
287 finder = func(parent INode, id string) INode {
288 pnode := parent.GetNode()
289 if pnode.loaderID == id {
290 return parent
291 }
292 for _, child := range pnode.children {
293 found := finder(child, id)
294 if found != nil {
295 return found
296 }
297 }
298 return nil
299 }
300 return finder(n, id)
301}
302
303// Children returns the list of children.
304func (n *Node) Children() []INode {

Callers 1

NewAnimationTargetsMethod · 0.80

Calls 1

GetNodeMethod · 0.65

Tested by

no test coverage detected