ArticyDatabaseGetObjectTObject Method (UInt64, UInt32) |
Namespace: Articy.Unity
public static TObject GetObject<TObject>( ulong aObjectId, uint aInstanceId = 0 ) where TObject : ArticyObject
This is the basic way of getting an articy object by its id. If the object is not found null will be returned. If you are using packages you might get null as a result to this call, but are sure that the object id is correct. In that case make sure the owning package is fully loaded.
Tip |
---|
Remember that C# understands numbers to be written in decimal or in hexadecimal notation. You can therefore just copy and paste the object id found in articy in the model sheet as the parameter to this method |
// this is the same as below but in hexadecimal notation (as in articy:draft) Character manfred2 = ArticyDatabase.GetObject<Character>(0x1000001000010C6); // this is basically the same as above just in decimal notation Character manfred3 = ArticyDatabase.GetObject<Character>(72057598332899526);