Hi ryanmiller,
Its important to remember that all those examples only work with actual project data. In most of the help articles we therefore reference the "Maniac Manfred" demo project. Some other code examples use dummy data.
In this case it is difficult to explain the ArticyTypeConstraint without having any type (as in an empty project), as those types are generated from your articy:draft data. And your articy:draft project data widely differs from others.
So this makes writing and therefore understanding the documentation a bit difficult.
Just try to remember that if you see classes not part of the plugin, it usually means to use types and data from your project.
I'm not sure where this Character class is supposed to be, or which classes are even available to reference. Ideally I'd like to find out how to get refs cast into FlowFragments. I'm on Unity 2018.3 with the plugin version 34886 2.0.3
In this case its possible to constraint directly to FlowFragment, as each articy:draft object gets a corresponding type in the plugin.
- Code: Select all
public class ArticyContent : MonoBehaviour
{
[ArticyTypeConstraint(typeof(FlowFragment))]
public ArticyRef articyModel;
}
Its also an important concept to understand that if you create a Template inside articy:draft for a type, it will get a corresponding class generated in the plugin. For example a template for entities, lets call it "Weapon". The plugin will generate a class Weapon for you deriving it from the C# class Entity which is part of the plugin, this allows you to use the type Weapon throughout your code. For example inside GetObject of your articyref.
Hope that clears it up, if you have any more questions let me know!
Best regards
Nico