Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
tetra-tower
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Oenos
tetra-tower
Commits
f352e138
Commit
f352e138
authored
6 years ago
by
18손재민
1
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'LifeStone' into tetris
parents
15f33ee6
5cb82644
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
11 deletions
+20
-11
Enumerators.cs
Assets/Scripts/Enumerators.cs
+7
-0
LifeStoneManager.cs
...Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
+9
-7
LifeStoneTest.cs
...ts/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneTest.cs
+4
-4
No files found.
Assets/Scripts/Enumerators.cs
View file @
f352e138
...
...
@@ -13,3 +13,10 @@ public enum AddonType
Component
,
Theory
}
public
enum
LifeStoneType
{
Normal
=
1
,
Gold
=
2
,
Amethyst
=
3
}
This diff is collapsed.
Click to expand it.
Assets/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
View file @
f352e138
...
...
@@ -68,6 +68,8 @@ public class LifeStoneManager : MonoBehaviour {
IEnumerator
TestEnumerator
()
{
yield
return
null
;
PushLifeStone
(
new
LifeStoneInfo
(
new
Vector2Int
(
3
,
8
),
"AAAAAAAAAAAAAAAAAAAAAAAA"
));
/*
PushLifeStone(new LifeStoneInfo(new Vector2Int(3, 1), "AAA"));
yield return new WaitForSeconds(2);
PushLifeStone(new LifeStoneInfo(new Vector2Int(3, 2), "AAAA A"));
...
...
@@ -320,12 +322,12 @@ public class LifeStoneManager : MonoBehaviour {
public
int
CountType
(
int
type
)
public
int
CountType
(
LifeStoneType
type
)
{
int
count
=
0
;
for
(
int
j
=
0
;
j
<
3
;
j
++)
for
(
int
i
=
0
;
i
<
lifeStoneRowNum
;
i
++)
if
(
lifeStoneArray
[
j
,
i
]
==
type
)
if
(
lifeStoneArray
[
j
,
i
]
==
(
int
)
type
)
count
++;
return
count
;
}
...
...
@@ -369,7 +371,7 @@ public class LifeStoneManager : MonoBehaviour {
}
}
public
void
ChangeFromNormal
(
int
type
,
int
num
)
public
void
ChangeFromNormal
(
LifeStoneType
type
,
int
num
)
{
System
.
Random
rnd
=
new
System
.
Random
();
ArrayList
candArray
=
new
ArrayList
();
...
...
@@ -382,18 +384,18 @@ public class LifeStoneManager : MonoBehaviour {
for
(
int
i
=
0
;
i
<
candArray
.
Count
;
i
++)
{
Vector2Int
vtmp
=
(
Vector2Int
)
candArray
[
i
];
lifeStoneArray
[
vtmp
.
y
,
vtmp
.
x
]
=
type
;
lifeStoneArray
[
vtmp
.
y
,
vtmp
.
x
]
=
(
int
)
type
;
}
StartCoroutine
(
ChangeInPhase
(
candArray
,
type
));
StartCoroutine
(
ChangeInPhase
(
candArray
,
(
int
)
type
));
}
public
void
ChangeToNormal
(
int
type
,
int
num
)
public
void
ChangeToNormal
(
LifeStoneType
type
,
int
num
)
{
System
.
Random
rnd
=
new
System
.
Random
();
ArrayList
candArray
=
new
ArrayList
();
for
(
int
j
=
0
;
j
<
lifeStoneRowNum
;
j
++)
for
(
int
i
=
0
;
i
<
3
;
i
++)
if
(
lifeStoneArray
[
j
,
i
]
==
type
)
if
(
lifeStoneArray
[
j
,
i
]
==
(
int
)
type
)
candArray
.
Add
(
new
Vector2Int
(
i
,
j
));
while
(
candArray
.
Count
>
num
)
candArray
.
RemoveAt
(
rnd
.
Next
(
candArray
.
Count
));
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneTest.cs
View file @
f352e138
...
...
@@ -23,14 +23,14 @@ public class LifeStoneTest : MonoBehaviour {
public
void
gold
()
{
int
tmp
=
Convert
.
ToInt32
(
goldText
.
GetComponent
<
InputField
>().
text
);
if
(
tmp
>
0
)
uii
.
ChangeFromNormal
(
2
,
tmp
);
else
if
(
tmp
<
0
)
uii
.
ChangeToNormal
(
2
,
-
tmp
);
if
(
tmp
>
0
)
uii
.
ChangeFromNormal
(
LifeStoneType
.
Gold
,
tmp
);
else
if
(
tmp
<
0
)
uii
.
ChangeToNormal
(
LifeStoneType
.
Gold
,
-
tmp
);
}
public
void
amethyst
()
{
int
tmp
=
Convert
.
ToInt32
(
amethystText
.
GetComponent
<
InputField
>().
text
);
if
(
tmp
>
0
)
uii
.
ChangeFromNormal
(
3
,
tmp
);
else
if
(
tmp
<
0
)
uii
.
ChangeToNormal
(
3
,
-
tmp
);
if
(
tmp
>
0
)
uii
.
ChangeFromNormal
(
LifeStoneType
.
Amethyst
,
tmp
);
else
if
(
tmp
<
0
)
uii
.
ChangeToNormal
(
LifeStoneType
.
Amethyst
,
-
tmp
);
}
public
void
dest
()
{
...
...
This diff is collapsed.
Click to expand it.
18김상언
@gggomksy
mentioned in commit
0460748a
·
6 years ago
mentioned in commit
0460748a
mentioned in commit 0460748ae5bbb1a85794b6109782a25439a1a160
Toggle commit list
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