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
ceee5693
Commit
ceee5693
authored
Oct 09, 2021
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
食物派对数量限制更好
parent
a1720fd6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
+21
-5
FFTPPipAnswerView.prefab
...dle/games/foodForTheParty/prefab/FFTPPipAnswerView.prefab
+0
-0
FFTPPipAnswerView.ts
...eBundle/games/foodForTheParty/script/FFTPPipAnswerView.ts
+1
-1
FoodForThePartyCtr.ts
...Bundle/games/foodForTheParty/script/FoodForThePartyCtr.ts
+20
-4
No files found.
assets/sceneBundle/games/foodForTheParty/prefab/FFTPPipAnswerView.prefab
View file @
ceee5693
This diff is collapsed.
Click to expand it.
assets/sceneBundle/games/foodForTheParty/script/FFTPPipAnswerView.ts
View file @
ceee5693
...
...
@@ -162,7 +162,7 @@ export class FFTPPipAnswerView extends Component {
playDisappearAct
(
endCb
?:
Function
)
{
this
.
mainNode
.
setPosition
(
0
,
this
.
orgV3
.
y
,
this
.
orgV3
.
z
);
tween
(
this
.
mainNode
)
.
delay
(
2
)
.
delay
(
1
)
.
to
(
0.5
,
{
position
:
v3
(
-
3000
,
this
.
orgV3
.
y
,
this
.
orgV3
.
z
)
})
.
call
(()
=>
{
if
(
typeof
endCb
==
"function"
)
{
...
...
assets/sceneBundle/games/foodForTheParty/script/FoodForThePartyCtr.ts
View file @
ceee5693
...
...
@@ -100,8 +100,8 @@ export class FoodForThePartyCtr extends Component {
//@ts-ignore
this
.
foodVarCount
=
resData
.
foodVarCount
;
}
//@ts-ignore
if
(
resData
.
foodNumCount
)
{
//@ts-ignore
if
(
resData
.
foodNumCount
)
{
//@ts-ignore
this
.
foodNumCount
=
resData
.
foodNumCount
;
}
...
...
@@ -285,6 +285,7 @@ export class FoodForThePartyCtr extends Component {
names
=
this
.
randomCopyNameToNameArr
(
names
);
names
=
this
.
disorderArr
(
names
);
names
=
this
.
excludeMoreFood
(
names
);
names
=
this
.
addLessFood
(
names
);
console
.
log
(
`
${
this
.
pips
[
i
].
getPipName
()}
管道的物品`
);
console
.
log
(
names
);
this
.
pips
[
i
].
setFoodsImgNames
(
this
.
imgHead
,
names
);
...
...
@@ -307,8 +308,23 @@ export class FoodForThePartyCtr extends Component {
}
outCount
+=
1
;
}
if
(
outCount
>=
10000
){
console
.
log
(
`食物数量限制可能发生死循环`
);
if
(
outCount
>=
10000
)
{
console
.
log
(
`食物数量减少限制可能发生死循环`
);
}
return
names
;
}
addLessFood
(
names
:
string
[]):
string
[]
{
if
(
this
.
foodVarCount
>=
this
.
foodNumCount
)
{
throw
new
Error
(
"食物种类大于食物数量限制"
);
}
let
outCount
=
0
;
while
(
names
.
length
<
this
.
foodNumCount
&&
outCount
<
10000
)
{
names
.
push
(
names
[
Math
.
floor
(
Math
.
random
()
*
names
.
length
)]);
outCount
+=
1
;
}
if
(
outCount
>=
10000
)
{
console
.
log
(
`食物数量增加限制可能发生死循环`
);
}
return
names
;
}
...
...
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