Commit 1ad21c4a authored by 范雪寒's avatar 范雪寒

feat:

parent 810ea134
...@@ -386,8 +386,8 @@ ...@@ -386,8 +386,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 0, "width": 2048,
"height": 0 "height": 1152
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -398,8 +398,8 @@ ...@@ -398,8 +398,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-59.759, -59.759000000000015,
277.71, 277.71000000000004,
0, 0,
0, 0,
0, 0,
...@@ -1219,7 +1219,7 @@ ...@@ -1219,7 +1219,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
0, 399.133,
0, 0,
0, 0,
0, 0,
...@@ -1399,7 +1399,7 @@ ...@@ -1399,7 +1399,7 @@
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0.5, "x": 0,
"y": 0.5 "y": 0.5
}, },
"_trs": { "_trs": {
...@@ -1627,7 +1627,7 @@ ...@@ -1627,7 +1627,7 @@
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0.5, "x": 0,
"y": 0.5 "y": 0.5
}, },
"_trs": { "_trs": {
......
...@@ -30,6 +30,18 @@ export default class PS_001_scene1 extends cc.Component { ...@@ -30,6 +30,18 @@ export default class PS_001_scene1 extends cc.Component {
init(cameraNode: cc.Node, parent: PS_001_Ctrl) {//4 init(cameraNode: cc.Node, parent: PS_001_Ctrl) {//4
this.camera = cameraNode this.camera = cameraNode
this.parent = parent this.parent = parent
this.camera.zIndex = 1;
const light_left = cc.find('Canvas/Main Camera/light_left');
const light_right = cc.find('Canvas/Main Camera/light_right');
const bg = cc.find('Canvas/Main Camera/bg');
light_left.active = false;
light_left.angle = 0;
light_right.active = false;
light_right.angle = 0;
bg.active = false;
if (PS_001_Ctrl.getIns().time == 0) { if (PS_001_Ctrl.getIns().time == 0) {
this.beforeStartFirstTime(); this.beforeStartFirstTime();
...@@ -42,9 +54,6 @@ export default class PS_001_scene1 extends cc.Component { ...@@ -42,9 +54,6 @@ export default class PS_001_scene1 extends cc.Component {
const light_left = cc.find('Canvas/Main Camera/light_left'); const light_left = cc.find('Canvas/Main Camera/light_left');
const light_right = cc.find('Canvas/Main Camera/light_right'); const light_right = cc.find('Canvas/Main Camera/light_right');
const bg = cc.find('Canvas/Main Camera/bg'); const bg = cc.find('Canvas/Main Camera/bg');
light_left.active = false;
light_right.active = false;
bg.active = false;
const canvas = cc.find('Canvas'); const canvas = cc.find('Canvas');
const zoom = this.camera.getComponent(cc.Camera).zoomRatio; const zoom = this.camera.getComponent(cc.Camera).zoomRatio;
const cameraWidth = canvas.width / zoom; const cameraWidth = canvas.width / zoom;
...@@ -54,6 +63,8 @@ export default class PS_001_scene1 extends cc.Component { ...@@ -54,6 +63,8 @@ export default class PS_001_scene1 extends cc.Component {
light_right.active = true; light_right.active = true;
bg.active = true; bg.active = true;
console.log('cameraWidth = ' + cameraWidth);
cc.tween(light_left) cc.tween(light_left)
.set({ x: -cameraWidth / 2, y: cameraHeight / 2 }) .set({ x: -cameraWidth / 2, y: cameraHeight / 2 })
.to(1, { angle: angle }, { easing: 'cubicIn' }) .to(1, { angle: angle }, { easing: 'cubicIn' })
......
...@@ -70,8 +70,7 @@ export default class PS_001_scene8 extends cc.Component { ...@@ -70,8 +70,7 @@ export default class PS_001_scene8 extends cc.Component {
.delay(5) .delay(5)
.delay(10) .delay(10)
.call(() => { .call(() => {
this.parent.toNext(8) this.onFinishFrirstTime();
this.node.destroy()
}) })
.start() .start()
} }
...@@ -123,8 +122,10 @@ export default class PS_001_scene8 extends cc.Component { ...@@ -123,8 +122,10 @@ export default class PS_001_scene8 extends cc.Component {
} else { } else {
const bg = cc.find('Canvas/Main Camera/bg'); const bg = cc.find('Canvas/Main Camera/bg');
bg.active = true; bg.active = true;
bg.zIndex = 1;
cc.tween(bg).to(1, { opacity: 255 }).start(); cc.tween(bg).to(1, { opacity: 255 }).start();
const wellDown = cc.find('Canvas/wellDown'); const wellDown = cc.find('Canvas/wellDown');
wellDown.zIndex = 1;
wellDown.active = true; wellDown.active = true;
wellDown.x = this.camera.x; wellDown.x = this.camera.x;
wellDown.y = this.camera.y; wellDown.y = this.camera.y;
...@@ -139,6 +140,7 @@ export default class PS_001_scene8 extends cc.Component { ...@@ -139,6 +140,7 @@ export default class PS_001_scene8 extends cc.Component {
} }
async onFinishFrirstTime() { async onFinishFrirstTime() {
console.log('汪汪汪8');
const canvas = cc.find('Canvas'); const canvas = cc.find('Canvas');
const zoom = this.camera.getComponent(cc.Camera).zoomRatio; const zoom = this.camera.getComponent(cc.Camera).zoomRatio;
const cameraWidth = canvas.width / zoom; const cameraWidth = canvas.width / zoom;
...@@ -146,6 +148,7 @@ export default class PS_001_scene8 extends cc.Component { ...@@ -146,6 +148,7 @@ export default class PS_001_scene8 extends cc.Component {
const ranbow = cc.find('Canvas/ranbow'); const ranbow = cc.find('Canvas/ranbow');
ranbow.active = true; ranbow.active = true;
ranbow.zIndex = 1;
ranbow.scale = (cameraHeight + 20) / ranbow.height; ranbow.scale = (cameraHeight + 20) / ranbow.height;
ranbow.x = cameraWidth / 2 + this.camera.x; ranbow.x = cameraWidth / 2 + this.camera.x;
ranbow.y = this.camera.y; ranbow.y = this.camera.y;
......
...@@ -52,46 +52,6 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -52,46 +52,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
PS_001_Ctrl.getIns().time = 1; PS_001_Ctrl.getIns().time = 1;
PS_001_Ctrl.getIns().goscene(conf[step].id); PS_001_Ctrl.getIns().goscene(conf[step].id);
}); });
// if (!cc.game.isPersistRootNode(cc.find('bk'))) {
// cc.game.addPersistRootNode(cc.find('bk'));
// cc.game.addPersistRootNode(cc.find('hand'));
// }
// cc.director.loadScene(`PS_001_scene1`);
// if (this.data.step == 0) {
// // handManager.getIns().isStart = false;
// cc.director.loadScene(`PS_001_scene1`, () => {
// // cc.find('Canvas').getComponent(`PS_001_scene1`).play();
// });
// } else if (this.data.step <= PS_001_handManager.getIns().conf.length + 1) {
// this.jumpToStep(this.data.step);
// } else {
// cc.director.loadScene(`PS_001_scene8`, () => {
// // cc.find('Canvas').getComponent(`PS_001_scene8`).play();
// });
// }
}
jumpToStep(step) {
const conf = [
null,
{ time: 5, scene: 1 },
{ time: 12, scene: 1 },
{ time: 9, scene: 2 },
{ time: 13, scene: 3 },
{ time: 18, scene: 4 },
{ time: 18, scene: 5 },
{ time: 10, scene: 6 },
{ time: 16, scene: 6 },
{ time: 18, scene: 7 },
{ time: 24, scene: 8 },
{ time: 33, scene: 8 },
{ time: 50, scene: 8 },
];
cc.director.loadScene(`PS_001_scene${conf[step].scene}`, () => {
cc.find('Canvas').getComponent(`PS_001_scene${conf[step].scene}`).play(step);
});
} }
playLocalAudio(audioName) { playLocalAudio(audioName) {
......
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