Commit 0f57e0a3 authored by 杨一航's avatar 杨一航

fix

parent 43aa1903
......@@ -40,6 +40,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
private _recordBefore: boolean = false;
private _myBear: cc.Node;
private _otherBear: cc.Node;
private _rightNow: boolean;
private _rightLast: boolean;
private _checkLast: any;
addPreloadImage() {
// TODO 根据自己的配置预加载图片资源
......@@ -342,7 +345,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
node2.position = this._bluePointRoot.getChildByName("0").position;
this._otherBear = node2.getChildByName("bear")
this.cat.getComponent(dragonBones.ArmatureDisplay).addEventListener(dragonBones.EventObject.COMPLETE, () => {
this.cat.getComponent(dragonBones.ArmatureDisplay).addEventListener(dragonBones.EventObject.COMPLETE, (entry, data) => {
console.log("ani complite");
this.catAni();
......@@ -361,6 +364,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
catAni(playAudio?) {
let state = this._status.state
if (this._checkLast) {
this._checkLast = false
this.cat.getComponent(dragonBones.ArmatureDisplay).playAnimation("normal", 0);
return
}
if (!this.isMySide) {
this.cat.getComponent(dragonBones.ArmatureDisplay).playAnimation("begin", 0);
......@@ -696,6 +704,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (isRight) {
if (this.isMySide) {
this._checkLast = true
this.cat.getComponent(dragonBones.ArmatureDisplay).playAnimation("right", 1);
}
......@@ -707,6 +716,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
} else {
if (this.isMySide) {
this._checkLast = true
this.cat.getComponent(dragonBones.ArmatureDisplay).playAnimation("wrong", 1);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment