Click or drag to resize

ExtensionMethodsTryGetRootParentTypeT Method

Attempts to get the uppermost type of an object in a GameObject tree.

Namespace:  DustProductions.Core
Assembly:  DustProductions.Core (in DustProductions.Core.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static bool TryGetRootParentType<T>(
	this Transform transform,
	out T outType
)
where T : Component

Parameters

transform
Type: Transform
The starting point of the search
outType
Type: T
The uppermost object of that type

Type Parameters

T
the type of object you are looking for

Return Value

Type: Boolean
True if an object is found

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Transform. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also