LiuQilin bd7742bf7b Temp 4.19 преди 8 години
..
src bd7742bf7b Temp 4.19 преди 8 години
README.md f2b9f60368 temp 4.18 преди 8 години
README.md.meta f2b9f60368 temp 4.18 преди 8 години
src.meta f2b9f60368 temp 4.18 преди 8 години

README.md

DragonBones Unity Library

How to use Demos

  1. Create a Unity project and import Demos files to override the project files.
  2. Import the DragonBones common source code to project Assets/Scripts.
  3. Import the DragonBones Unity source code to project Assets/Scripts.
  4. Import the 3rdParty source code to project Assets/Scripts.
  5. Run project and have fun.

Notice

  • Maker sure project structure like this:

    project
    |-- Assets
        |-- Scripts
            |-- DragonBones
                |-- animation
                |-- armature
                |-- ...
                |-- unity
                |-- ...
            |-- 3rdParty Scripts
            |-- Demos Scripts
            |-- ...
        |-- Resources
            |-- DragonBonesData files
            |-- ...
        |-- ...
    |-- ...
    

How to create a new Unity project with DragonBones animation

  1. Create a new project in Unity.
  2. Import DragonBones core library and unity library into your project "[Project]/Assets/Scripts/".
  3. Import the 3rdParty source code to your project "[Project]/Assets/Scripts/".
  4. Export DB animation files with DragonBones Pro to your project "[Project]/Assets/Resources/".
  5. 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);
    }
    }