• 大小: 12.13MB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2023-07-16
  • 语言: 其他
  • 标签: DragonBones  龙骨  

资源简介

unity DragonBones龙骨插件 龙骨补间动画2d插件。unity插件包可以直接使用。拷贝到Assets目录。修改bug可以直接使用。

资源截图

代码片段和文件信息

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DragonBones;

public class Animationbase : baseDemo
{
    private UnityArmatureComponent _armatureComp;

    protected override void onstart()
    {
        // Load Data
        UnityFactory.factory.LoadDragonBonesData(“progress_bar/progress_bar_ske“);
        UnityFactory.factory.LoadTextureAtlasData(“progress_bar/progress_bar_tex“);

        // Build Armature
        this._armatureComp = UnityFactory.factory.BuildArmatureComponent(“progress_bar“);
// Add Listeners
        this._armatureComp.AddDBEventListener(Eventobject.START this.OnAnimationEventHandler);
        this._armatureComp.AddDBEventListener(Eventobject.LOOP_COMPLETE this.OnAnimationEventHandler);
        this._armatureComp.AddDBEventListener(Eventobject.COMPLETE this.OnAnimationEventHandler);
        this._armatureComp.AddDBEventListener(Eventobject.FADE_IN this.OnAnimationEventHandler);
        this._armatureComp.AddDBEventListener(Eventobject.FADE_IN_COMPLETE this.OnAnimationEventHandler);
        this._armatureComp.AddDBEventListener(Eventobject.FADE_OUT this.OnAnimationEventHandler);
        this._armatureComp.AddDBEventListener(Eventobject.FADE_OUT_COMPLETE this.OnAnimationEventHandler);
        this._armatureComp.AddDBEventListener(Eventobject.frame_EVENT this.OnAnimationEventHandler);

this._armatureComp.animation.Play(“idle“);
    }

protected override void OnTouch(TouchType type)
{
var mouseWorldPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
var localPosition = this._armatureComp.transform.localPosition;
var progress = (mouseWorldPosition.x - localPosition.x + 3.0f) / 6.0f;
progress = Mathf.Min(Mathf.Max(progress 0.0f) 1.0f);
switch(type)
{
case TouchType.TOUCH_BEGIN:
{
this._armatureComp.animation.GotoAndStopByProgress(“idle“ progress);
}
break;
case TouchType.TOUCH_END:
{
this._armatureComp.animation.Play();
}
break;
case TouchType.TOUCH_MOVE:
{
var animationState = this._armatureComp.animation.GetState(“idle“);
if(animationState != null)
{
animationState.currentTime = animationState.totalTime * progress;
}
}
break;
}
}

    private void OnAnimationEventHandler(string type Eventobject eventobject)
    {
UnityEngine.Debug.Log(string.Format(“animationName:{0}eventType:{1}eventName:{2}“ eventobject.animationState.name type eventobject.name));
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-12-13 19:41  DragonBones龙骨插件\
     目录           0  2019-12-13 19:41  DragonBones龙骨插件\Demos\
     文件         192  2019-01-17 22:14  DragonBones龙骨插件\Demos.meta
     目录           0  2019-12-13 19:41  DragonBones龙骨插件\Demos\DraResources\
     文件         192  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources.meta
     文件       19624  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\background.png
     文件        2410  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\background.png.meta
     目录           0  2019-12-13 19:41  DragonBones龙骨插件\Demos\DraResources\bounding_box_tester\
     文件         192  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\bounding_box_tester.meta
     文件        2940  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\bounding_box_tester\bounding_box_tester_ske.json
     文件         178  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\bounding_box_tester\bounding_box_tester_ske.json.meta
     文件         221  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\bounding_box_tester\bounding_box_tester_tex.json
     文件         178  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\bounding_box_tester\bounding_box_tester_tex.json.meta
     文件        2898  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\bounding_box_tester\bounding_box_tester_tex.png
     文件        1607  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\bounding_box_tester\bounding_box_tester_tex.png.meta
     目录           0  2019-12-13 19:41  DragonBones龙骨插件\Demos\DraResources\bullet_01\
     文件         192  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\bullet_01.meta
     文件         959  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\bullet_01\bullet_01_ske.json
     文件         178  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\bullet_01\bullet_01_ske.json.meta
     文件         159  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\bullet_01\bullet_01_tex.json
     文件         178  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\bullet_01\bullet_01_tex.json.meta
     文件        2636  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\bullet_01\bullet_01_tex.png
     文件        1607  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\bullet_01\bullet_01_tex.png.meta
     目录           0  2019-12-13 19:41  DragonBones龙骨插件\Demos\DraResources\floor_board\
     文件         192  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\floor_board.meta
     文件        2323  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\floor_board\floor_board_ske.json
     文件         178  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\floor_board\floor_board_ske.json.meta
     文件         409  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\floor_board\floor_board_tex.json
     文件         178  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\floor_board\floor_board_tex.json.meta
     文件       98112  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\floor_board\floor_board_tex.png
     文件        1607  2019-01-17 22:14  DragonBones龙骨插件\Demos\DraResources\floor_board\floor_board_tex.png.meta
............此处省略590个文件信息

评论

共有 条评论

相关资源