Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NJ_MoTianLun
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
NJ_MoTianLun
Commits
e6a58718
Commit
e6a58718
authored
Jun 13, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 摩天轮滚动效果
parent
b9610f59
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
209 additions
and
90 deletions
+209
-90
MoveRandom.ts
assets/NJ_MoTianLun/scene/MoveRandom.ts
+31
-0
MoveRandom.ts.meta
assets/NJ_MoTianLun/scene/MoveRandom.ts.meta
+9
-0
NJ_MoTianLun.fire
assets/NJ_MoTianLun/scene/NJ_MoTianLun.fire
+148
-78
NJ_MoTianLun.ts
assets/NJ_MoTianLun/scene/NJ_MoTianLun.ts
+21
-12
No files found.
assets/NJ_MoTianLun/scene/MoveRandom.ts
0 → 100644
View file @
e6a58718
import
{
RandomInt
}
from
"
../script/util
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
@
ccclass
export
default
class
NewClass
extends
cc
.
Component
{
@
property
rotate
:
number
=
10
;
basePos
:
cc
.
Vec2
;
start
()
{
this
.
basePos
=
this
.
node
.
getPosition
();
this
.
float
();
}
float
()
{
const
rotation
=
RandomInt
(
this
.
rotate
,
-
this
.
rotate
);
cc
.
tween
(
this
.
node
)
.
to
(
RandomInt
(
2
,
4
),
{
angle
:
rotation
,
},
{
easing
:
'
sineInOut
'
})
.
to
(
RandomInt
(
2
,
4
),
{
angle
:
-
rotation
,
},
{
easing
:
'
sineInOut
'
})
.
call
(()
=>
{
this
.
float
();
})
.
start
();
}
}
assets/NJ_MoTianLun/scene/MoveRandom.ts.meta
0 → 100644
View file @
e6a58718
{
"ver": "1.0.8",
"uuid": "d11b3378-e2e7-45c2-aba9-672280474f96",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
assets/NJ_MoTianLun/scene/NJ_MoTianLun.fire
View file @
e6a58718
...
...
@@ -78,13 +78,13 @@
"_active": true,
"_components": [
{
"__id__":
56
"__id__":
61
},
{
"__id__":
57
"__id__":
62
},
{
"__id__":
58
"__id__":
63
}
],
"_prefab": null,
...
...
@@ -245,22 +245,22 @@
"__id__": 6
},
{
"__id__": 4
4
"__id__": 4
9
},
{
"__id__":
47
"__id__":
52
},
{
"__id__": 5
1
"__id__": 5
6
}
],
"_active": true,
"_components": [
{
"__id__": 5
4
"__id__": 5
9
},
{
"__id__":
55
"__id__":
60
}
],
"_prefab": null,
...
...
@@ -323,25 +323,25 @@
"__id__": 7
},
{
"__id__": 1
4
"__id__": 1
5
},
{
"__id__": 2
1
"__id__": 2
3
},
{
"__id__":
28
"__id__":
31
},
{
"__id__": 3
5
"__id__": 3
9
}
],
"_active": true,
"_components": [
{
"__id__": 4
2
"__id__": 4
7
},
{
"__id__": 4
3
"__id__": 4
8
}
],
"_prefab": null,
...
...
@@ -414,6 +414,9 @@
},
{
"__id__": 13
},
{
"__id__": 14
}
],
"_prefab": null,
...
...
@@ -678,7 +681,7 @@
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode":
tru
e,
"_isTrimmedMode":
fals
e,
"_atlas": null,
"_id": "40TXFdXUVK85d2sQFmpF24"
},
...
...
@@ -750,6 +753,17 @@
"_N$target": null,
"_id": "d8Hnt37aNGXZtTAZ7vxo1n"
},
{
"__type__": "d11b3N44udFwqupZyKAR0+W",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"rotate": 10,
"_id": "b0qNLToulLGoOj8/2FRtbR"
},
{
"__type__": "cc.Node",
"_name": "star_1",
...
...
@@ -759,19 +773,22 @@
},
"_children": [
{
"__id__": 1
5
"__id__": 1
6
},
{
"__id__": 1
7
"__id__": 1
8
}
],
"_active": true,
"_components": [
{
"__id__":
19
"__id__":
20
},
{
"__id__": 20
"__id__": 21
},
{
"__id__": 22
}
],
"_prefab": null,
...
...
@@ -827,13 +844,13 @@
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 1
4
"__id__": 1
5
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
6
"__id__": 1
7
}
],
"_prefab": null,
...
...
@@ -889,7 +906,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
5
"__id__": 1
6
},
"_enabled": true,
"_materials": [
...
...
@@ -921,13 +938,13 @@
"_name": "lock",
"_objFlags": 0,
"_parent": {
"__id__": 1
4
"__id__": 1
5
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
8
"__id__": 1
9
}
],
"_prefab": null,
...
...
@@ -983,7 +1000,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
7
"__id__": 1
8
},
"_enabled": true,
"_materials": [
...
...
@@ -1015,7 +1032,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
4
"__id__": 1
5
},
"_enabled": true,
"_materials": [
...
...
@@ -1045,7 +1062,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
4
"__id__": 1
5
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -1108,6 +1125,17 @@
"_N$target": null,
"_id": "60VUZZkj5AfYKtRclmmHpY"
},
{
"__type__": "d11b3N44udFwqupZyKAR0+W",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
},
"_enabled": true,
"rotate": 10,
"_id": "5dxBgU9p5HeKQnuhXJ7gx2"
},
{
"__type__": "cc.Node",
"_name": "star_2",
...
...
@@ -1117,19 +1145,22 @@
},
"_children": [
{
"__id__": 2
2
"__id__": 2
4
},
{
"__id__": 2
4
"__id__": 2
6
}
],
"_active": true,
"_components": [
{
"__id__": 2
6
"__id__": 2
8
},
{
"__id__": 27
"__id__": 29
},
{
"__id__": 30
}
],
"_prefab": null,
...
...
@@ -1185,13 +1216,13 @@
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 2
1
"__id__": 2
3
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
3
"__id__": 2
5
}
],
"_prefab": null,
...
...
@@ -1247,7 +1278,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
2
"__id__": 2
4
},
"_enabled": true,
"_materials": [
...
...
@@ -1279,13 +1310,13 @@
"_name": "lock",
"_objFlags": 0,
"_parent": {
"__id__": 2
1
"__id__": 2
3
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
5
"__id__": 2
7
}
],
"_prefab": null,
...
...
@@ -1341,7 +1372,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
4
"__id__": 2
6
},
"_enabled": true,
"_materials": [
...
...
@@ -1373,7 +1404,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
1
"__id__": 2
3
},
"_enabled": true,
"_materials": [
...
...
@@ -1403,7 +1434,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
1
"__id__": 2
3
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -1466,6 +1497,17 @@
"_N$target": null,
"_id": "5frveIvU9DSaPXx28UMQSn"
},
{
"__type__": "d11b3N44udFwqupZyKAR0+W",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
},
"_enabled": true,
"rotate": 10,
"_id": "723U90GXpOu4gJ9z+q7QLG"
},
{
"__type__": "cc.Node",
"_name": "star_3",
...
...
@@ -1475,19 +1517,22 @@
},
"_children": [
{
"__id__":
29
"__id__":
32
},
{
"__id__": 3
1
"__id__": 3
4
}
],
"_active": true,
"_components": [
{
"__id__": 3
3
"__id__": 3
6
},
{
"__id__": 34
"__id__": 37
},
{
"__id__": 38
}
],
"_prefab": null,
...
...
@@ -1543,13 +1588,13 @@
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__":
28
"__id__":
31
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
0
"__id__": 3
3
}
],
"_prefab": null,
...
...
@@ -1605,7 +1650,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
29
"__id__":
32
},
"_enabled": true,
"_materials": [
...
...
@@ -1637,13 +1682,13 @@
"_name": "lock",
"_objFlags": 0,
"_parent": {
"__id__":
28
"__id__":
31
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
2
"__id__": 3
5
}
],
"_prefab": null,
...
...
@@ -1699,7 +1744,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
1
"__id__": 3
4
},
"_enabled": true,
"_materials": [
...
...
@@ -1731,7 +1776,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
28
"__id__":
31
},
"_enabled": true,
"_materials": [
...
...
@@ -1761,7 +1806,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
28
"__id__":
31
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -1824,6 +1869,17 @@
"_N$target": null,
"_id": "c3lPs0AzVHTaa8dNpPnQCS"
},
{
"__type__": "d11b3N44udFwqupZyKAR0+W",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 31
},
"_enabled": true,
"rotate": 10,
"_id": "42QO8Pq7xAs7o0RT/PuAuj"
},
{
"__type__": "cc.Node",
"_name": "star_4",
...
...
@@ -1833,19 +1889,22 @@
},
"_children": [
{
"__id__":
36
"__id__":
40
},
{
"__id__":
38
"__id__":
42
}
],
"_active": true,
"_components": [
{
"__id__": 4
0
"__id__": 4
4
},
{
"__id__": 41
"__id__": 45
},
{
"__id__": 46
}
],
"_prefab": null,
...
...
@@ -1901,13 +1960,13 @@
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 3
5
"__id__": 3
9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
37
"__id__":
41
}
],
"_prefab": null,
...
...
@@ -1963,7 +2022,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
36
"__id__":
40
},
"_enabled": true,
"_materials": [
...
...
@@ -1995,13 +2054,13 @@
"_name": "lock",
"_objFlags": 0,
"_parent": {
"__id__": 3
5
"__id__": 3
9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
39
"__id__":
43
}
],
"_prefab": null,
...
...
@@ -2057,7 +2116,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
38
"__id__":
42
},
"_enabled": true,
"_materials": [
...
...
@@ -2089,7 +2148,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
5
"__id__": 3
9
},
"_enabled": true,
"_materials": [
...
...
@@ -2119,7 +2178,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
5
"__id__": 3
9
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -2182,6 +2241,17 @@
"_N$target": null,
"_id": "c8+Go/aBlNcYywwkIKuu8b"
},
{
"__type__": "d11b3N44udFwqupZyKAR0+W",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 39
},
"_enabled": true,
"rotate": 10,
"_id": "0f0jSnhb5Po5QrEgifeAWD"
},
{
"__type__": "cc.Sprite",
"_name": "",
...
...
@@ -2252,10 +2322,10 @@
"_active": true,
"_components": [
{
"__id__":
45
"__id__":
50
},
{
"__id__":
46
"__id__":
51
}
],
"_prefab": null,
...
...
@@ -2311,7 +2381,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
4
"__id__": 4
9
},
"_enabled": true,
"_materials": [
...
...
@@ -2343,7 +2413,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
4
"__id__": 4
9
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -2376,13 +2446,13 @@
"_active": true,
"_components": [
{
"__id__":
48
"__id__":
53
},
{
"__id__":
49
"__id__":
54
},
{
"__id__": 5
0
"__id__": 5
5
}
],
"_prefab": null,
...
...
@@ -2438,7 +2508,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
47
"__id__":
52
},
"_enabled": true,
"_materials": [
...
...
@@ -2470,7 +2540,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
47
"__id__":
52
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -2497,7 +2567,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
47
"__id__":
52
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -2558,7 +2628,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__":
47
"__id__":
52
},
"_id": "57sri6u3tM1YhZPPIbspjz"
},
...
...
@@ -2573,10 +2643,10 @@
"_active": true,
"_components": [
{
"__id__": 5
2
"__id__": 5
7
},
{
"__id__": 5
3
"__id__": 5
8
}
],
"_prefab": null,
...
...
@@ -2632,7 +2702,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
1
"__id__": 5
6
},
"_enabled": true,
"_materials": [
...
...
@@ -2664,7 +2734,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
1
"__id__": 5
6
},
"_enabled": true,
"alignMode": 1,
...
...
assets/NJ_MoTianLun/scene/NJ_MoTianLun.ts
View file @
e6a58718
import
{
asyncCallNetworkApiGet
,
asyncCallNetworkApiPost
,
asyncDelay
,
buttonOnClick
,
onHomeworkFinish
}
from
"
../script/util
"
;
import
{
asyncCallNetworkApiGet
,
asyncCallNetworkApiPost
,
asyncDelay
,
buttonOnClick
,
onHomeworkFinish
,
jumpToBundle
}
from
"
../script/util
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
...
...
@@ -23,6 +23,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
return
null
;
}
showTips
(
tips
)
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
!
middleLayer
)
{
console
.
log
(
tips
);
return
;
}
middleLayer
.
getComponent
(
'
middleLayer
'
).
showTips
(
tips
);
}
async
onLoadEnd
()
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
...
...
@@ -35,20 +44,24 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
const
kidData
=
JSON
.
parse
(
kidDataStr
);
if
(
!
kidData
.
data
||
!
kidData
.
data
.
id
)
{
middleLayer
.
getComponent
(
'
middleLayer
'
)
.
showTips
(
"
用户登录失效,请重新登录
"
);
middleLayer
.
getComponent
(
'
middleLayer
'
).
loadOnline
Bundle
(
"
NJ_login
"
);
this
.
showTips
(
"
用户登录失效,请重新登录
"
);
jumpTo
Bundle
(
"
NJ_login
"
);
return
;
}
const
btnReturn
=
cc
.
find
(
'
Canvas/bg/btn_return
'
);
buttonOnClick
(
btnReturn
,
()
=>
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
middleLayer
)
{
middleLayer
.
getComponent
(
'
middleLayer
'
).
loadOnlineBundle
(
'
NJ_YouLeChang
'
);
}
jumpToBundle
(
'
NJ_YouLeChang
'
);
});
const
pid
=
middleLayer
.
getComponent
(
'
middleLayer
'
).
getData
(
'
NJ_MoTianLun
'
);
// 播放背景音乐
cc
.
audioEngine
.
stopMusic
();
cc
.
audioEngine
.
playMusic
(
this
.
bgMusic1
,
true
);
if
(
!
middleLayer
)
{
return
;
}
const
pid
=
middleLayer
.
getComponent
(
'
middleLayer
'
).
getData
(
'
NJ_MoTianLun
'
);
const
classDataStr
=
await
asyncCallNetworkApiGet
(
'
/api/syllabus/v1/list
'
,
{
pid
:
pid
});
...
...
@@ -63,7 +76,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
return
{
id
:
row
.
id
,
locked
:
locked
};
});
console
.
log
(
ballData
);
ballData
.
forEach
((
data
,
idx
)
=>
{
if
(
idx
>=
5
)
{
...
...
@@ -108,9 +120,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
});
// 播放背景音乐
cc
.
audioEngine
.
stopMusic
();
cc
.
audioEngine
.
playMusic
(
this
.
bgMusic1
,
true
);
}
protected
update
(
dt
:
number
):
void
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment