![]() |
Init(args)
Scripting Reference
|
Extensions methods for UnityEngine.Object type classes that can be used to add components or clone objects while injecting values into fields and properties of the created instance using reflection.
This can make it easier to create unit tests for MonoBehaviour-derived classes as it allows one to set the values of non-public fields which in normal use-cases might be meant to only be assigned only through the inspector.
Static Public Member Functions | |
static TObject | Instantiate< TObject > ([DisallowNull] this TObject original, [DisallowNull] params(string name, object value)[] arguments) |
Clones the original TObject , initializes it with the given argument and then returns the clone. | |
static TObject | Instantiate< TObject > ([DisallowNull] this TObject original, [DisallowNull] params object[] arguments) |
Clones the original TObject , initializes it with the given argument and then returns the clone. | |