Commit b2ae07d0 authored by Guo Yuhang's avatar Guo Yuhang

add:finish taget

Signed-off-by: Guo Yuhang's avatar郭宇航 <guoyuhang@iplayabc.com>
parent d05bf343
import { onHomeworkFinish } from "../script/common/utils";
/** /**
* 游戏主逻辑 * 游戏主逻辑
*/ */
...@@ -173,6 +175,7 @@ var game = cc.Class({ ...@@ -173,6 +175,7 @@ var game = cc.Class({
} }
// this.showEndEffect(); // this.showEndEffect();
// this.showRestartBtn(); // this.showRestartBtn();
onHomeworkFinish();
}) })
}) })
}, },
......
...@@ -226,4 +226,15 @@ async function rabbonFall(node) { ...@@ -226,4 +226,15 @@ async function rabbonFall(node) {
const offsetX = RandomInt(-200, 200) * time; const offsetX = RandomInt(-200, 200) * time;
await asyncTweenBy(node, time, { x: offsetX, angle: offsetX * 60 / 200 }); await asyncTweenBy(node, time, { x: offsetX, angle: offsetX * 60 / 200 });
rabbonFall(node); rabbonFall(node);
}
export function onHomeworkFinish() {
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer');
if (middleLayerComponent.role == 'student') {
middleLayerComponent.onHomeworkFinish(() => { });
}
} else {
console.log('onHomeworkFinish');
}
} }
\ No newline at end of file
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