Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
interactiveGames_Level
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
xuxing@jiuaoedu.com
interactiveGames_Level
Commits
62bcc43e
Commit
62bcc43e
authored
Sep 16, 2021
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关卡完成流程可以跑通了
parent
53993467
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
36 deletions
+79
-36
ChallengeFailView.prefab
...neBundle/games/commonView/prefab/ChallengeFailView.prefab
+49
-21
ChallengeFailView.ts
.../sceneBundle/games/commonView/script/ChallengeFailView.ts
+3
-2
ChallengeSuccView.ts
.../sceneBundle/games/commonView/script/ChallengeSuccView.ts
+7
-2
SchulteCtr.ts
assets/sceneBundle/games/schulte/script/SchulteCtr.ts
+6
-0
LevelHomeCtr.ts
assets/startFolder/script/LevelHomeCtr.ts
+8
-6
LevelMgr.ts
assets/startFolder/script/LevelMgr.ts
+6
-5
No files found.
assets/sceneBundle/games/commonView/prefab/ChallengeFailView.prefab
View file @
62bcc43e
...
@@ -32,23 +32,23 @@
...
@@ -32,23 +32,23 @@
"__id__": 30
"__id__": 30
},
},
{
{
"__id__": 3
8
"__id__": 3
9
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
"__id__": 46
},
{
{
"__id__": 48
"__id__": 48
},
},
{
{
"__id__": 50
"__id__": 50
},
{
"__id__": 52
}
}
],
],
"_prefab": {
"_prefab": {
"__id__": 5
2
"__id__": 5
4
},
},
"_lpos": {
"_lpos": {
"__type__": "cc.Vec3",
"__type__": "cc.Vec3",
...
@@ -677,7 +677,7 @@
...
@@ -677,7 +677,7 @@
}
}
],
],
"_prefab": {
"_prefab": {
"__id__": 3
7
"__id__": 3
8
},
},
"_lpos": {
"_lpos": {
"__type__": "cc.Vec3",
"__type__": "cc.Vec3",
...
@@ -790,7 +790,11 @@
...
@@ -790,7 +790,11 @@
"__prefab": {
"__prefab": {
"__id__": 36
"__id__": 36
},
},
"clickEvents": [],
"clickEvents": [
{
"__id__": 37
}
],
"_interactable": true,
"_interactable": true,
"_transition": 3,
"_transition": 3,
"_normalColor": {
"_normalColor": {
...
@@ -837,6 +841,16 @@
...
@@ -837,6 +841,16 @@
"__type__": "cc.CompPrefabInfo",
"__type__": "cc.CompPrefabInfo",
"fileId": "bab2m7GQpEdK7/w/Xyxise"
"fileId": "bab2m7GQpEdK7/w/Xyxise"
},
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "8a7161MaaNDPaefS5tbTQY9",
"handler": "onBackBtnClick",
"customEventData": ""
},
{
{
"__type__": "cc.PrefabInfo",
"__type__": "cc.PrefabInfo",
"root": {
"root": {
...
@@ -858,17 +872,17 @@
...
@@ -858,17 +872,17 @@
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
39
"__id__":
40
},
},
{
{
"__id__": 4
1
"__id__": 4
2
},
},
{
{
"__id__": 4
3
"__id__": 4
4
}
}
],
],
"_prefab": {
"_prefab": {
"__id__": 4
5
"__id__": 4
7
},
},
"_lpos": {
"_lpos": {
"__type__": "cc.Vec3",
"__type__": "cc.Vec3",
...
@@ -903,11 +917,11 @@
...
@@ -903,11 +917,11 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 3
8
"__id__": 3
9
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": {
"__id__": 4
0
"__id__": 4
1
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
...
@@ -930,11 +944,11 @@
...
@@ -930,11 +944,11 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 3
8
"__id__": 3
9
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": {
"__id__": 4
2
"__id__": 4
3
},
},
"_visFlags": 0,
"_visFlags": 0,
"_customMaterial": null,
"_customMaterial": null,
...
@@ -975,13 +989,17 @@
...
@@ -975,13 +989,17 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 3
8
"__id__": 3
9
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": {
"__id__": 4
4
"__id__": 4
5
},
},
"clickEvents": [],
"clickEvents": [
{
"__id__": 46
}
],
"_interactable": true,
"_interactable": true,
"_transition": 3,
"_transition": 3,
"_normalColor": {
"_normalColor": {
...
@@ -1028,6 +1046,16 @@
...
@@ -1028,6 +1046,16 @@
"__type__": "cc.CompPrefabInfo",
"__type__": "cc.CompPrefabInfo",
"fileId": "f6YaZtthBERbd7xsEBpWCk"
"fileId": "f6YaZtthBERbd7xsEBpWCk"
},
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "8a7161MaaNDPaefS5tbTQY9",
"handler": "onContinueBtnClick",
"customEventData": ""
},
{
{
"__type__": "cc.PrefabInfo",
"__type__": "cc.PrefabInfo",
"root": {
"root": {
...
@@ -1047,7 +1075,7 @@
...
@@ -1047,7 +1075,7 @@
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": {
"__id__": 4
7
"__id__": 4
9
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
...
@@ -1074,7 +1102,7 @@
...
@@ -1074,7 +1102,7 @@
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": {
"__id__":
49
"__id__":
51
},
},
"_alignFlags": 45,
"_alignFlags": 45,
"_target": null,
"_target": null,
...
@@ -1109,7 +1137,7 @@
...
@@ -1109,7 +1137,7 @@
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": {
"__id__": 5
1
"__id__": 5
3
},
},
"_id": ""
"_id": ""
},
},
...
...
assets/sceneBundle/games/commonView/script/ChallengeFailView.ts
View file @
62bcc43e
import
{
_decorator
,
Component
,
Node
,
director
}
from
'cc'
;
import
{
_decorator
,
Component
,
Node
,
director
}
from
'cc'
;
import
{
levelMgr
}
from
'../../../../startFolder/script/LevelMgr'
;
const
{
ccclass
,
property
}
=
_decorator
;
const
{
ccclass
,
property
}
=
_decorator
;
@
ccclass
(
'ChallengeFailView'
)
@
ccclass
(
'ChallengeFailView'
)
...
@@ -14,10 +15,10 @@ export class ChallengeFailView extends Component {
...
@@ -14,10 +15,10 @@ export class ChallengeFailView extends Component {
}
}
onBackBtnClick
()
{
onBackBtnClick
()
{
director
.
emit
(
""
);
levelMgr
.
backLevelHome
(
);
}
}
onContinueBtnClick
()
{
onContinueBtnClick
()
{
director
.
emit
(
""
);
levelMgr
.
loadLevel
(
);
}
}
}
}
assets/sceneBundle/games/commonView/script/ChallengeSuccView.ts
View file @
62bcc43e
import
{
_decorator
,
Component
,
Node
,
Label
,
director
}
from
'cc'
;
import
{
_decorator
,
Component
,
Node
,
Label
,
director
}
from
'cc'
;
import
{
Utils
}
from
'../../../../startFolder/script/common/Utils'
;
import
{
Utils
}
from
'../../../../startFolder/script/common/Utils'
;
import
{
levelMgr
}
from
'../../../../startFolder/script/LevelMgr'
;
const
{
ccclass
,
property
}
=
_decorator
;
const
{
ccclass
,
property
}
=
_decorator
;
@
ccclass
(
'ChallengeSuccView'
)
@
ccclass
(
'ChallengeSuccView'
)
...
@@ -34,11 +35,14 @@ export class ChallengeSuccView extends Component {
...
@@ -34,11 +35,14 @@ export class ChallengeSuccView extends Component {
}
}
onBackBtnClick
()
{
onBackBtnClick
()
{
director
.
emit
(
""
);
if
(
levelMgr
.
unLockCount
<=
levelMgr
.
runLevel
)
levelMgr
.
unLockCount
+=
1
;
levelMgr
.
backLevelHome
();
}
}
onContinueBtnClick
()
{
onContinueBtnClick
()
{
director
.
emit
(
""
);
if
(
levelMgr
.
unLockCount
<=
levelMgr
.
runLevel
)
levelMgr
.
unLockCount
+=
1
;
levelMgr
.
runLevel
+=
1
;
levelMgr
.
loadLevel
();
}
}
}
}
\ No newline at end of file
assets/sceneBundle/games/schulte/script/SchulteCtr.ts
View file @
62bcc43e
...
@@ -196,6 +196,12 @@ export class SchulteCtr extends Component {
...
@@ -196,6 +196,12 @@ export class SchulteCtr extends Component {
});
});
}
}
onDestroy
(){
director
.
off
(
"click_block"
);
director
.
off
(
"continue_game"
);
director
.
off
(
"begin_countdown_end"
);
}
reset
()
{
reset
()
{
// tween(this.node).stop();
// tween(this.node).stop();
this
.
isPlayCountdownMus
=
false
;
this
.
isPlayCountdownMus
=
false
;
...
...
assets/startFolder/script/LevelHomeCtr.ts
View file @
62bcc43e
...
@@ -20,11 +20,13 @@ export class LevelHomeCtr extends Component {
...
@@ -20,11 +20,13 @@ export class LevelHomeCtr extends Component {
start
()
{
start
()
{
// [3]
// [3]
if
(
!
levelMgr
.
loadedOutData
)
{
levelMgr
.
loadedOutData
=
true
;
levelMgr
.
gameIdHead
=
10
;
levelMgr
.
unLockCount
=
1
;
}
//
//
director
.
on
(
"load_level"
,
this
.
loadLevel
,
this
);
director
.
on
(
"load_level"
,
this
.
loadLevel
,
this
);
levelMgr
.
gameIdHead
=
10
;
levelMgr
.
unLockCount
=
1
;
this
.
updateStar
();
this
.
updateStar
();
}
}
...
@@ -51,17 +53,17 @@ export class LevelHomeCtr extends Component {
...
@@ -51,17 +53,17 @@ export class LevelHomeCtr extends Component {
starArr
.
push
(
this
.
secondLayout
!
.
children
[
i
]
!
.
getComponent
(
LevelStarCtr
)
!
);
starArr
.
push
(
this
.
secondLayout
!
.
children
[
i
]
!
.
getComponent
(
LevelStarCtr
)
!
);
}
}
let
levelArr
=
levelMgr
.
getLevelItfArr
(
levelMgr
.
gameIdHead
);
let
levelArr
=
levelMgr
.
getLevelItfArr
(
levelMgr
.
gameIdHead
);
console
.
log
(
`个数`
,
count
);
//
console.log(`个数`, count);
for
(
let
i
=
0
;
i
<
starArr
.
length
;
++
i
)
{
for
(
let
i
=
0
;
i
<
starArr
.
length
;
++
i
)
{
if
(
i
>=
count
)
starArr
[
i
].
node
.
active
=
false
;
if
(
i
>=
count
)
starArr
[
i
].
node
.
active
=
false
;
else
starArr
[
i
].
node
.
active
=
true
;
else
starArr
[
i
].
node
.
active
=
true
;
if
(
i
>=
count
)
continue
;
if
(
i
>=
count
)
continue
;
if
(
!
levelArr
[
i
])
continue
;
if
(
!
levelArr
[
i
])
continue
;
starArr
[
i
].
setLevel
(
levelArr
[
i
].
level
);
starArr
[
i
].
setLevel
(
levelArr
[
i
].
level
);
if
(
i
<
levelMgr
.
unLockCount
)
{
if
(
i
<
levelMgr
.
unLockCount
-
1
)
{
starArr
[
i
].
setFinish
();
starArr
[
i
].
setFinish
();
}
}
else
if
(
i
==
levelMgr
.
unLockCount
)
{
else
if
(
i
==
levelMgr
.
unLockCount
-
1
)
{
starArr
[
i
].
setUnLock
();
starArr
[
i
].
setUnLock
();
}
}
else
{
else
{
...
...
assets/startFolder/script/LevelMgr.ts
View file @
62bcc43e
...
@@ -14,7 +14,8 @@ class LevelMgr {
...
@@ -14,7 +14,8 @@ class LevelMgr {
}
}
//
//
private
_gameIdHead
=
0
;
public
loadedOutData
=
false
;
private
_gameIdHead
=
10
;
public
set
gameIdHead
(
value
:
number
){
public
set
gameIdHead
(
value
:
number
){
this
.
_gameIdHead
=
value
;
this
.
_gameIdHead
=
value
;
}
}
...
@@ -22,7 +23,7 @@ class LevelMgr {
...
@@ -22,7 +23,7 @@ class LevelMgr {
public
get
gameIdHead
(){
public
get
gameIdHead
(){
return
this
.
_gameIdHead
;
return
this
.
_gameIdHead
;
}
}
private
_unLockCount
=
0
;
private
_unLockCount
=
1
;
public
set
unLockCount
(
value
:
number
){
public
set
unLockCount
(
value
:
number
){
if
(
value
>
this
.
getLevelCount
(
this
.
_gameIdHead
))
return
;
if
(
value
>
this
.
getLevelCount
(
this
.
_gameIdHead
))
return
;
this
.
_unLockCount
=
value
;
this
.
_unLockCount
=
value
;
...
@@ -32,7 +33,7 @@ class LevelMgr {
...
@@ -32,7 +33,7 @@ class LevelMgr {
return
this
.
_unLockCount
;
return
this
.
_unLockCount
;
}
}
private
_runLevel
=
0
;
private
_runLevel
=
1
;
public
set
runLevel
(
value
:
number
){
public
set
runLevel
(
value
:
number
){
if
(
value
>
this
.
getLevelCount
(
this
.
_gameIdHead
))
return
;
if
(
value
>
this
.
getLevelCount
(
this
.
_gameIdHead
))
return
;
this
.
_runLevel
=
value
;
this
.
_runLevel
=
value
;
...
@@ -64,8 +65,8 @@ class LevelMgr {
...
@@ -64,8 +65,8 @@ class LevelMgr {
}
}
public
backLevelHome
(){
public
backLevelHome
(){
director
.
loadScene
(
"
begin
"
,
()
=>
{
director
.
loadScene
(
"
LevelScene
"
,
()
=>
{
find
(
"Canvas"
)?.
getComponent
(
"LevelHomeCtr"
);
});
});
}
}
...
...
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