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
687d2a78
Commit
687d2a78
authored
Oct 11, 2021
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数独加了一个还原按钮
parent
2b156c67
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
Sudoku_1.scene
assets/sceneBundle/games/sudoku/scene/Sudoku_1.scene
+0
-0
SudokuCtr.ts
assets/sceneBundle/games/sudoku/script/SudokuCtr.ts
+4
-0
SudokuItemCtr.ts
assets/sceneBundle/games/sudoku/script/SudokuItemCtr.ts
+17
-3
No files found.
assets/sceneBundle/games/sudoku/scene/Sudoku_1.scene
View file @
687d2a78
This diff is collapsed.
Click to expand it.
assets/sceneBundle/games/sudoku/script/SudokuCtr.ts
View file @
687d2a78
...
@@ -67,6 +67,10 @@ export class SudokuCtr extends Component {
...
@@ -67,6 +67,10 @@ export class SudokuCtr extends Component {
this
.
gameStart
();
this
.
gameStart
();
}
}
onResetBtn
(){
director
.
emit
(
"resetItem"
);
}
onDestroy
()
{
onDestroy
()
{
director
.
off
(
"sk_item_click"
,
this
.
onItemClick
,
this
);
director
.
off
(
"sk_item_click"
,
this
.
onItemClick
,
this
);
director
.
off
(
"begin_countdown_end"
);
director
.
off
(
"begin_countdown_end"
);
...
...
assets/sceneBundle/games/sudoku/script/SudokuItemCtr.ts
View file @
687d2a78
...
@@ -35,8 +35,22 @@ export class SudokuItemCtr extends Component {
...
@@ -35,8 +35,22 @@ export class SudokuItemCtr extends Component {
}
}
onItemClick
()
{
onItemClick
()
{
if
(
this
.
itemType
==
SK_ITEM_TYPE
.
INVARIABLE
)
return
;
//
if (this.itemType == SK_ITEM_TYPE.INVARIABLE) return;
director
.
emit
(
"sk_item_click"
,
this
);
director
.
emit
(
"sk_item_click"
,
this
);
director
.
on
(
"resetItem"
,
this
.
resetItem
,
this
);
}
resetItem
()
{
if
(
this
.
itemType
==
SK_ITEM_TYPE
.
INVARIABLE
)
{
this
.
numLab
.
string
=
this
.
rightNumStr
;
}
else
{
this
.
numLab
.
string
=
""
;
}
}
onDestroy
()
{
director
.
off
(
"resetItem"
,
this
.
resetItem
,
this
);
}
}
getItemType
()
{
getItemType
()
{
...
@@ -60,14 +74,14 @@ export class SudokuItemCtr extends Component {
...
@@ -60,14 +74,14 @@ export class SudokuItemCtr extends Component {
this
.
setNumStr
(
numStr
);
this
.
setNumStr
(
numStr
);
this
.
rightNumStr
=
numStr
;
this
.
rightNumStr
=
numStr
;
this
.
bgSpr
.
color
=
color
;
this
.
bgSpr
.
color
=
color
;
if
(
type
==
SK_ITEM_TYPE
.
VARIABLE
)
{
if
(
type
==
SK_ITEM_TYPE
.
VARIABLE
)
{
this
.
setNumStr
(
""
);
this
.
setNumStr
(
""
);
}
}
this
.
posIfo
=
posIfo
;
this
.
posIfo
=
posIfo
;
this
.
posIfo
.
target
=
this
.
node
;
this
.
posIfo
.
target
=
this
.
node
;
}
}
isRight
(){
isRight
()
{
return
this
.
numLab
.
string
==
this
.
rightNumStr
;
return
this
.
numLab
.
string
==
this
.
rightNumStr
;
}
}
...
...
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