Click or drag to resize

ArticyRef Class

Used to expose articy objects safely in your unity components.
Inheritance Hierarchy
SystemObject
  Articy.UnityArticyRef

Namespace:  Articy.Unity
Assembly:  ArticyRuntime (in ArticyRuntime.dll) Version: 1.0.3
Syntax
C#
[SerializableAttribute]
public class ArticyRef : ISerializationCallbackReceiver

The ArticyRef type exposes the following members.

Constructors
  NameDescription
Public methodArticyRef
Top
Properties
  NameDescription
Public propertyHasReference
Gets a value indicating whether this instance has an assigned reference.
Top
Methods
Operators
Fields
  NameDescription
Public fieldinstanceId
The instance id of the referenced object
Public fieldreferencingMode
Describes how the ArticyRef will handle the underlying reference, especially when calling GetObject.
Top
Remarks

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.

Examples
C#
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.
    }
}
See Also