Commit 2ea67568 authored by Guo Yuhang's avatar Guo Yuhang

add:finish taget

Signed-off-by: Guo Yuhang's avatar郭宇航 <guoyuhang@iplayabc.com>
parent 5420c4eb
......@@ -4,6 +4,8 @@ import { DefaultData } from '../script/DefaultData';
import EventMgr from '../script/EventMgr';
import VerletRender from "../script/verlet_render";
import BezierRender from "../script/bezier_render";
import { onHomeworkFinish } from "../script/utils";
const POS = {
LeftPage: { x: -239, y: -5 },
RightPage: { x: 239, y: -5 },
......@@ -440,8 +442,8 @@ cc.Class({
// })
// let spf2 = spf1;
cc.tween(page1)
.to(1, {opacity: 0})
.start();
.to(1, { opacity: 0 })
.start();
let page2 = this.pageList[GameData.pageIndex - 1];
if (page2) {
......@@ -449,39 +451,39 @@ cc.Class({
// spf2 = this.capture.doCapture(page2);
// page2.opacity = 0;
// this.scheduleOnce(() => {
page2.x = POS.RightPage.x;
page2.x = POS.RightPage.x;
// })
if (page0) {
cc.tween(page0)
// .delay(1)
.to(1, {opacity: 0})
.start();
// .delay(1)
.to(1, { opacity: 0 })
.start();
}
cc.tween(page2)
// .delay(1)
.to(1, {opacity: 255})
.to(1, { opacity: 255 })
.call(() => {
this.resetPages()
})
.start();
.start();
}
let page3 = this.pageList[GameData.pageIndex - 2]
if (page3) {
// this.scheduleOnce(() => {
page3.opacity = 0;
page3.opacity = 0;
// })
cc.tween(page3)
// .delay(1)
.to(1, {opacity: 255})
// .delay(1)
.to(1, { opacity: 255 })
.call(() => {
onHomeworkFinish();
})
.start();
}
}
// let node = cc.instantiate(this.pfbItemTurnPage2);
......@@ -541,8 +543,8 @@ cc.Class({
// let spf2 = spf1;
cc.tween(page1)
.to(1, {opacity: 0})
.to(1, { opacity: 0 })
.start();
let page2 = this.pageList[GameData.pageIndex + 2]
......@@ -551,26 +553,26 @@ cc.Class({
// spf2 = this.capture.doCapture(page2, true);
// page2.opacity = 0;
// this.scheduleOnce(() => {
page2.x = POS.LeftPage.x;
page2.x = POS.LeftPage.x;
// })
cc.tween(page0)
// .delay(1)
.to(1, {opacity: 0})
.to(1, { opacity: 0 })
.start();
cc.tween(page2)
// .delay(1)
.to(1, {opacity: 255})
.to(1, { opacity: 255 })
.call(() => {
this.resetPages()
})
.start();
.start();
}
let page3 = this.pageList[GameData.pageIndex + 3]
if (page3) {
// this.scheduleOnce(() => {
page3.opacity = 255;
page3.opacity = 255;
// })
}
......
......@@ -196,4 +196,15 @@ async function rabbonFall(node) {
const offsetX = RandomInt(-200, 200) * time;
await asyncTweenBy(node, time, { x: offsetX, angle: offsetX * 60 / 200 });
rabbonFall(node);
}
\ No newline at end of file
}
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