godot.extensions.NodeExt.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of godot-library-debug Show documentation
Show all versions of godot-library-debug Show documentation
Contains godot api as kotlin classes and jvm cpp interaction code.
@file:JvmName("NodeUtils")
package godot.extensions
import godot.Node
import godot.core.NodePath
import godot.core.StringName
import godot.core.asNodePath
@Suppress("NOTHING_TO_INLINE", "UNCHECKED_CAST")
inline fun Node.getNodeAs(path: String) = getNode(path.asNodePath()) as T?
@Suppress("NOTHING_TO_INLINE", "UNCHECKED_CAST")
inline fun Node.getNodeAs(path: StringName) = getNode(path.asNodePath()) as T?
@Suppress("NOTHING_TO_INLINE", "UNCHECKED_CAST")
inline fun Node.getNodeAs(nodePath: NodePath) = getNode(nodePath) as T?