ArticyRef Class
Used to expose articy objects safely in your unity components.
Namespace: Articy.UnityAssembly: ArticyRuntime (in ArticyRuntime.dll) Version: 1.3.0
[SerializableAttribute]
public class ArticyRef : ISerializationCallbackReceiver
- Inheritance
- Object ArticyRef
- Implements
- ISerializationCallbackReceiver
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.
}
}
| HasReference |
Gets a value indicating whether this instance has an assigned reference.
|
| GetObject |
Gets the referenced object.
|
| GetObjectTObject |
Gets the the referenced object and tries to cast it into the given type
|