Notice
Maker sure project structure like this:
project
|-- Assets
|-- Scripts
|-- DragonBones
|-- animation
|-- armature
|-- ...
|-- unity
|-- ...
|-- 3rdParty Scripts
|-- Demos Scripts
|-- ...
|-- Resources
|-- DragonBonesData files
|-- ...
|-- ...
|-- ...
Create a new C# script like following:
public class HelloDragonBones :MonoBehaviour
{
void Start()
{
// Load data.
UnityFactory.factory.LoadDragonBonesData("Ubbie/Ubbie"); // DragonBones file path (without suffix)
UnityFactory.factory.LoadTextureAtlasData("Ubbie/texture"); //Texture atlas file path (without suffix)
// Create armature.
var armatureComponent =UnityFactory.factory.BuildArmatureComponent("ubbie"); // Input armature name
// Play animation.
armatureComponent.animation.Play("walk");
// Change armatureposition.
armatureComponent.transform.localPosition = new Vector3(0.0f, 0.0f,0.0f);
}
}