Click or drag to resize

ExtensionMethodsDuplicateT Method (T, Boolean, Boolean)

Clones a generic type.

Namespace:  DustProductions.Core
Assembly:  DustProductions.Core (in DustProductions.Core.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static T Duplicate<T>(
	this T obj,
	bool keepWorldPos = false,
	bool makeNextChild = false
)
where T : Component

Parameters

obj
Type: T
The thing you are cloning
keepWorldPos (Optional)
Type: SystemBoolean
Whether or not to keep the position of the object in world space
makeNextChild (Optional)
Type: SystemBoolean
Whether or not to make this object the next child in the hierarchy

Type Parameters

T
Whatever type of thing you are trying to clone

Return Value

Type: T
The cloned object

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . 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