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

fix

parent 43aa1903
...@@ -40,6 +40,9 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -40,6 +40,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
private _recordBefore: boolean = false; private _recordBefore: boolean = false;
private _myBear: cc.Node; private _myBear: cc.Node;
private _otherBear: cc.Node; private _otherBear: cc.Node;
private _rightNow: boolean;
private _rightLast: boolean;
private _checkLast: any;
addPreloadImage() { addPreloadImage() {
// TODO 根据自己的配置预加载图片资源 // TODO 根据自己的配置预加载图片资源
...@@ -342,7 +345,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -342,7 +345,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
node2.position = this._bluePointRoot.getChildByName("0").position; node2.position = this._bluePointRoot.getChildByName("0").position;
this._otherBear = node2.getChildByName("bear") 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"); console.log("ani complite");
this.catAni(); this.catAni();
...@@ -361,6 +364,11 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -361,6 +364,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
catAni(playAudio?) { catAni(playAudio?) {
let state = this._status.state let state = this._status.state
if (this._checkLast) {
this._checkLast = false
this.cat.getComponent(dragonBones.ArmatureDisplay).playAnimation("normal", 0);
return
}
if (!this.isMySide) { if (!this.isMySide) {
this.cat.getComponent(dragonBones.ArmatureDisplay).playAnimation("begin", 0); this.cat.getComponent(dragonBones.ArmatureDisplay).playAnimation("begin", 0);
...@@ -696,6 +704,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -696,6 +704,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (isRight) { if (isRight) {
if (this.isMySide) { if (this.isMySide) {
this._checkLast = true
this.cat.getComponent(dragonBones.ArmatureDisplay).playAnimation("right", 1); this.cat.getComponent(dragonBones.ArmatureDisplay).playAnimation("right", 1);
} }
...@@ -707,6 +716,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -707,6 +716,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
} else { } else {
if (this.isMySide) { if (this.isMySide) {
this._checkLast = true
this.cat.getComponent(dragonBones.ArmatureDisplay).playAnimation("wrong", 1); 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