Click or drag to resize

ArticyDatabaseGetObjectTObject Method (String)

Gets an object by its technical name and returning it in the specified type.

Namespace:  Articy.Unity
Assembly:  ArticyRuntime (in ArticyRuntime.dll) Version: 1.0.3
Syntax
C#
public static TObject GetObject<TObject>(
	string aTechnicalName
)
where TObject : ArticyObject

Parameters

aTechnicalName
Type: SystemString
The technical name of the object in question.

Type Parameters

TObject
The desired target type of the object.

Return Value

Type: TObject
he found object with the given aTechnicalName or null if the name doesn't exist in the database or the owning package is not loaded.
Remarks

This is the basic way of getting an articy object by its technical name. If the object is not found null will be returned.

Note Note
The technical name is case sensitive.
Tip Tip
If you are using packages you might get null as a result to this call, but are sure that the objects technical name is correct. In that case make sure the owning package is fully loaded.
Caution note Caution
Because articy:draft doesn't enforce technical name uniqueness, it is possible to have multiple objects with the same technical name. At the moment this isn't fully supported and this method will the first object with the given technical name, the order is unspecified. If you can't assure unique technical names, you might be safer using the overload.
Examples
C#
// get the object by its technical name and as the specified type
Character manfred1 = ArticyDatabase.GetObject<Character>("Chr_Manfred");
See Also