一:如何兼容使用龙骨动画 请参考https://www.cnblogs.com/NightFrost/p/9585296.html 插件下载地址https://github.com/DragonBones/DragonBonesCSharp/releases/tag/5.6.300
二:如何代码创建一个龙骨动画
public UnityDragonBonesData dragonBoneData;
void Start()
{
DragonBonesData _tigerData = UnityFactory.factory.LoadData(dragonBoneData);
UnityArmatureComponent TigerARmatureComponent = UnityFactory.factory.BuildArmatureComponent("tiger", "tigerObject");
TigerARmatureComponent.animation.Play("24DongWuXuanYun");
TigerARmatureComponent.name = "testName";
TigerARmatureComponent.transform.localPosition = new Vector3(0.15f, -2.34f, 1.0f);
}
三:换装
Slot theSlot = TigerARmatureComponent.armature.GetSlot("TB");
UnityFactory.factory.ReplaceSlotDisplay("tigerObject", "tiger", "TB", "animal/TB/TB002", theSlot);
|