Click or drag to resize

ExtensionMethodsDuplicate Method (GameObject, Boolean, Boolean)

Creates a clone of a gameobject.

Namespace:  DustProductions.Core
Assembly:  DustProductions.Core (in DustProductions.Core.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static GameObject Duplicate(
	this GameObject go,
	bool keepWorldPos = false,
	bool makeNextChild = false
)

Parameters

go
Type: GameObject
The gameobject to clone
keepWorldPos (Optional)
Type: SystemBoolean
Whether or not to keep the position of the gameobject in world space
makeNextChild (Optional)
Type: SystemBoolean
Whether or not to make this gameobject the next child in the hierarchy

Return Value

Type: GameObject
The cloned gameobject

Usage Note

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