ArticyRef Class |
Namespace: Articy.Unity
[SerializableAttribute] public class ArticyRef : ISerializationCallbackReceiver
The ArticyRef type exposes the following members.
Name | Description | |
---|---|---|
HasReference |
Gets a value indicating whether this instance has an assigned reference.
|
Name | Description | |
---|---|---|
GetObject |
Gets the referenced object.
| |
GetObjectTObject |
Gets the the referenced object and tries to cast it into the given type
|
Name | Description | |
---|---|---|
(ArticyObject to ArticyRef) |
Performs an explicit conversion from ArticyObject to ArticyRef.
| |
(ArticyRef to ArticyObject) |
Performs an explicit conversion from ArticyRef to ArticyObject.
|
Name | Description | |
---|---|---|
instanceId |
The instance id of the referenced object
| |
referencingMode |
Describes how the ArticyRef will handle the underlying reference, especially when calling GetObject.
|
Use this type to create custom fields in your scripts to hold weak references of articy objects and expose them to the unity inspector to allow the designers to easily modify them.
ArticyRef makes sure that the object is properly stored even when rebuilding the database without loosing the actual reference. This class even keeps the reference to the object if your import doesn't contain the referenced model anymore.
class MyScript : MonoBehaviour { public ArticyRef offHandItem; void Start() { var item = offHandItem.GetObject<Entity>(); // Entity is used for this example. If you use that example in your code, the type of the object depends on the Template. } }