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
21de9755
Commit
21de9755
authored
Feb 04, 2019
by
18류지석
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
이제 LifeStoneManager.InstantiateDroppedLifeStone으로 원하는 위치에 생명석 만들 수 있음. 그리고 선택된 아이템과 생명석이 가장 앞으로 옴
parent
66309959
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
113 additions
and
70 deletions
+113
-70
DroppedItem.prefab
Assets/Prefabs/UI/In-Game UI/InventoryUI/DroppedItem.prefab
+3
-3
LifeUnitHighlight.prefab
...refabs/UI/In-Game UI/LifeStoneUI/LifeUnitHighlight.prefab
+3
-3
LifeStoneTestUI.prefab
Assets/Prefabs/UI/LifeStoneTestUI.prefab
+1
-1
PlayScene.unity
Assets/Scenes/PlayScene.unity
+0
-15
PlayerController.cs
Assets/Scripts/Characters/PlayerController.cs
+1
-2
DroppedItem.cs
Assets/Scripts/Item/DroppedItem.cs
+2
-0
DroppedLifeStone.cs
...Scripts/UI/In-game UI/LifeStoneScript/DroppedLifeStone.cs
+10
-5
LifeStoneManager.cs
...Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
+92
-40
LifeStoneTest.cs
...ts/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneTest.cs
+1
-1
No files found.
Assets/Prefabs/UI/In-Game UI/InventoryUI/DroppedItem.prefab
View file @
21de9755
...
@@ -209,9 +209,9 @@ SpriteRenderer:
...
@@ -209,9 +209,9 @@ SpriteRenderer:
m_AutoUVMaxDistance
:
0.5
m_AutoUVMaxDistance
:
0.5
m_AutoUVMaxAngle
:
89
m_AutoUVMaxAngle
:
89
m_LightmapParameters
:
{
fileID
:
0
}
m_LightmapParameters
:
{
fileID
:
0
}
m_SortingLayerID
:
996861525
m_SortingLayerID
:
2145601713
m_SortingLayer
:
8
m_SortingLayer
:
9
m_SortingOrder
:
0
m_SortingOrder
:
-1
m_Sprite
:
{
fileID
:
0
}
m_Sprite
:
{
fileID
:
0
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
m_FlipX
:
0
m_FlipX
:
0
...
...
Assets/Prefabs/UI/In-Game UI/LifeStoneUI/LifeUnitHighlight.prefab
View file @
21de9755
...
@@ -72,9 +72,9 @@ SpriteRenderer:
...
@@ -72,9 +72,9 @@ SpriteRenderer:
m_AutoUVMaxDistance
:
0.5
m_AutoUVMaxDistance
:
0.5
m_AutoUVMaxAngle
:
89
m_AutoUVMaxAngle
:
89
m_LightmapParameters
:
{
fileID
:
0
}
m_LightmapParameters
:
{
fileID
:
0
}
m_SortingLayerID
:
996861525
m_SortingLayerID
:
2145601713
m_SortingLayer
:
8
m_SortingLayer
:
9
m_SortingOrder
:
0
m_SortingOrder
:
-1
m_Sprite
:
{
fileID
:
21300000
,
guid
:
aa7dc19ed61c9bd45b964e4bdf98b84b
,
type
:
3
}
m_Sprite
:
{
fileID
:
21300000
,
guid
:
aa7dc19ed61c9bd45b964e4bdf98b84b
,
type
:
3
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
m_FlipX
:
0
m_FlipX
:
0
...
...
Assets/Prefabs/UI/LifeStoneTestUI.prefab
View file @
21de9755
...
@@ -145,7 +145,7 @@ GameObject:
...
@@ -145,7 +145,7 @@ GameObject:
-
component
:
{
fileID
:
114072708642970626
}
-
component
:
{
fileID
:
114072708642970626
}
-
component
:
{
fileID
:
114757692378018086
}
-
component
:
{
fileID
:
114757692378018086
}
m_Layer
:
5
m_Layer
:
5
m_Name
:
Push
Button
m_Name
:
Create
Button
m_TagString
:
Untagged
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_NavMeshLayer
:
0
...
...
Assets/Scenes/PlayScene.unity
View file @
21de9755
...
@@ -506,21 +506,6 @@ Prefab:
...
@@ -506,21 +506,6 @@ Prefab:
propertyPath
:
m_Pivot.y
propertyPath
:
m_Pivot.y
value
:
0
value
:
0
objectReference
:
{
fileID
:
0
}
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
224627740379736590
,
guid
:
799f0e9cc16535e449586b399b37aa56
,
type
:
2
}
propertyPath
:
m_LocalScale.x
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
224627740379736590
,
guid
:
799f0e9cc16535e449586b399b37aa56
,
type
:
2
}
propertyPath
:
m_LocalScale.y
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
224627740379736590
,
guid
:
799f0e9cc16535e449586b399b37aa56
,
type
:
2
}
propertyPath
:
m_LocalScale.z
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
114627791461826676
,
guid
:
799f0e9cc16535e449586b399b37aa56
,
-
target
:
{
fileID
:
114627791461826676
,
guid
:
799f0e9cc16535e449586b399b37aa56
,
type
:
2
}
type
:
2
}
propertyPath
:
ui
propertyPath
:
ui
...
...
Assets/Scripts/Characters/PlayerController.cs
View file @
21de9755
...
@@ -102,12 +102,11 @@ public class PlayerController : MonoBehaviour
...
@@ -102,12 +102,11 @@ public class PlayerController : MonoBehaviour
if
(
lastDropItem
!=
null
&&
interaction
)
if
(
lastDropItem
!=
null
&&
interaction
)
{
{
print
(
lastDropItem
.
PushItem
()
+
"냠냠"
);
lastDropItem
.
PushItem
(
);
}
}
if
(
lastLifeStone
!=
null
&&
interaction
)
if
(
lastLifeStone
!=
null
&&
interaction
)
{
{
lastLifeStone
.
ApplyLifeStone
();
lastLifeStone
.
ApplyLifeStone
();
print
(
"생명석 냠냠"
);
}
}
}
}
...
...
Assets/Scripts/Item/DroppedItem.cs
View file @
21de9755
...
@@ -65,5 +65,7 @@ public class DroppedItem : MonoBehaviour
...
@@ -65,5 +65,7 @@ public class DroppedItem : MonoBehaviour
public
void
HighlightSwitch
(
bool
enabled
)
public
void
HighlightSwitch
(
bool
enabled
)
{
{
highlight
.
SetActive
(
enabled
);
highlight
.
SetActive
(
enabled
);
highlight
.
GetComponent
<
SpriteRenderer
>().
sortingOrder
=
-
1
+
(
enabled
?
2
:
0
);
GetComponent
<
SpriteRenderer
>().
sortingOrder
=
(
enabled
?
2
:
0
);
}
}
}
}
Assets/Scripts/UI/In-game UI/LifeStoneScript/DroppedLifeStone.cs
View file @
21de9755
...
@@ -32,7 +32,7 @@ public class DroppedLifeStone : MonoBehaviour
...
@@ -32,7 +32,7 @@ public class DroppedLifeStone : MonoBehaviour
unitObj
=
new
GameObject
[
inSize
.
x
*
inSize
.
y
];
unitObj
=
new
GameObject
[
inSize
.
x
*
inSize
.
y
];
highObj
=
new
GameObject
[
inSize
.
x
*
inSize
.
y
];
highObj
=
new
GameObject
[
inSize
.
x
*
inSize
.
y
];
transform
.
position
=
pos
-
new
Vector3
(
inSize
.
x
*
unitSize
,
0
,
0
);
transform
.
position
=
pos
-
new
Vector3
(
inSize
.
x
*
unitSize
/
2f
,
0
,
0
);
for
(
int
i
=
0
;
i
<
inSize
.
x
*
inSize
.
y
;
i
++)
for
(
int
i
=
0
;
i
<
inSize
.
x
*
inSize
.
y
;
i
++)
{
{
...
@@ -44,7 +44,7 @@ public class DroppedLifeStone : MonoBehaviour
...
@@ -44,7 +44,7 @@ public class DroppedLifeStone : MonoBehaviour
highObj
[
i
]
=
Instantiate
(
highlightSprite
,
transform
);
highObj
[
i
]
=
Instantiate
(
highlightSprite
,
transform
);
highObj
[
i
].
transform
.
localPosition
=
unitObj
[
i
].
transform
.
localPosition
;
highObj
[
i
].
transform
.
localPosition
=
unitObj
[
i
].
transform
.
localPosition
;
highObj
[
i
].
GetComponent
<
SpriteRenderer
>().
enabled
=
false
;
highObj
[
i
].
SetActive
(
false
)
;
}
}
}
}
bc2D
.
offset
=
new
Vector2
(
unitSize
*
inSize
.
x
/
2f
,
unitSize
*
inSize
.
y
/
2f
);
bc2D
.
offset
=
new
Vector2
(
unitSize
*
inSize
.
x
/
2f
,
unitSize
*
inSize
.
y
/
2f
);
...
@@ -52,7 +52,7 @@ public class DroppedLifeStone : MonoBehaviour
...
@@ -52,7 +52,7 @@ public class DroppedLifeStone : MonoBehaviour
}
}
public
void
ApplyLifeStone
()
public
void
ApplyLifeStone
()
{
{
GameObject
.
Find
(
"LifeStoneUI"
).
GetComponent
<
LifeStoneManager
>().
PushLifeStone
(
info
);
if
(
GameObject
.
Find
(
"LifeStoneUI"
).
GetComponent
<
LifeStoneManager
>().
PushLifeStone
(
info
))
Destroy
(
gameObject
);
Destroy
(
gameObject
);
}
}
public
void
HighlightSwitch
(
bool
enabled
)
public
void
HighlightSwitch
(
bool
enabled
)
...
@@ -62,7 +62,12 @@ public class DroppedLifeStone : MonoBehaviour
...
@@ -62,7 +62,12 @@ public class DroppedLifeStone : MonoBehaviour
for
(
int
i
=
0
;
i
<
inSize
.
x
*
inSize
.
y
;
i
++)
for
(
int
i
=
0
;
i
<
inSize
.
x
*
inSize
.
y
;
i
++)
{
{
if
(
inFill
[
i
]
!=
' '
)
if
(
inFill
[
i
]
!=
' '
)
highObj
[
i
].
GetComponent
<
SpriteRenderer
>().
enabled
=
enabled
;
{
highObj
[
i
].
SetActive
(
enabled
);
highObj
[
i
].
GetComponent
<
SpriteRenderer
>().
sortingOrder
=
-
1
+
(
enabled
?
2
:
0
);
unitObj
[
i
].
GetComponent
<
SpriteRenderer
>().
sortingOrder
=
(
enabled
?
2
:
0
);
}
}
}
}
}
}
}
\ No newline at end of file
Assets/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
View file @
21de9755
...
@@ -64,58 +64,59 @@ public class LifeStoneManager : MonoBehaviour {
...
@@ -64,58 +64,59 @@ public class LifeStoneManager : MonoBehaviour {
lifeStoneUnit
=
new
GameObject
[
50
,
3
];
lifeStoneUnit
=
new
GameObject
[
50
,
3
];
for
(
int
i
=
0
;
i
<
50
;
i
++)
for
(
int
j
=
0
;
j
<
3
;
j
++)
lifeStoneArray
[
i
,
j
]
=
0
;
for
(
int
i
=
0
;
i
<
50
;
i
++)
for
(
int
j
=
0
;
j
<
3
;
j
++)
lifeStoneArray
[
i
,
j
]
=
0
;
//StartCoroutine("TestEnumerator");
//StartCoroutine("TestEnumerator");
PushLifeStone
(
new
LifeStoneInfo
(
new
Vector2Int
(
3
,
8
),
"AAAAAAAAAAAAAAAAAAAAAAAA"
));
PushLifeStone
(
CreateLifeStoneInfo
(
new
Vector2Int
(
3
,
6
),
0
,
0
));
}
}
IEnumerator
TestEnumerator
()
IEnumerator
TestEnumerator
()
{
{
yield
return
null
;
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"));
yield return new WaitForSeconds(2);
PushLifeStone(new LifeStoneInfo(new Vector2Int(3, 2), "AAAA A"));
yield return new WaitForSeconds(2);
PushLifeStone(new LifeStoneInfo(new Vector2Int(3, 2), "AAAA A"));
yield return new WaitForSeconds(2);
PushLifeStone(new LifeStoneInfo(new Vector2Int(3, 2), "AAAA A"));
yield return new WaitForSeconds(2);
PushLifeStone(new LifeStoneInfo(new Vector2Int(3, 2), "AAAA A"));
yield return new WaitForSeconds(2);
PushLifeStone(new LifeStoneInfo(new Vector2Int(3, 2), "AAAA A"));
yield return new WaitForSeconds(2);
/*PushLifeStone(CreateLifeStoneInfo(5, 0.2f, 3));
yield return new WaitForSeconds(2);
PushLifeStone(CreateLifeStoneInfo(3, 0.2f, 0));
yield return new WaitForSeconds(2);
PushLifeStone(CreateLifeStoneInfo(4, 0.2f, 0));
yield return new WaitForSeconds(2);
InstantiateDroppedLifeStone(CreateLifeStoneInfo(4, 0.1f, 0), GameObject.Find("Player").transform.position + new Vector3(2,2,0));
yield return new WaitForSeconds(2);
ExpandRow(4);
PushLifeStone(new LifeStoneInfo(new Vector2Int(3, 8), "AAAAAAAAAAAAAAAAAAAAAAAA"));
PushLifeStone(new LifeStoneInfo(new Vector2Int(2, 5), " AAAABA A "));
yield return new WaitForSeconds(2);
PushLifeStone(new LifeStoneInfo(new Vector2Int(2, 3), " AAA A"));
yield return new WaitForSeconds(2);
ChangeFromNormal(2, 5);
yield return new WaitForSeconds(2);
ChangeToNormal(2, 3);
yield return new WaitForSeconds(2);
DestroyStone(3);*/
}
}
/// <summary>
/// expand lifestoneframe row
/// </summary>
/// <param name="rowNum"></param>
public
void
ExpandRow
(
int
rowNum
)
public
void
ExpandRow
(
int
rowNum
)
{
{
lifeStoneRowNum
+=
rowNum
;
lifeStoneRowNum
+=
rowNum
;
frameSuper
.
GetComponent
<
LifeStoneFrame
>().
AddRow
(
lifeStoneRowNum
);
frameSuper
.
GetComponent
<
LifeStoneFrame
>().
AddRow
(
lifeStoneRowNum
);
}
}
/// <summary>
/// Instantiate Dropped LifeStone
/// </summary>
/// <param name="info"></param>
/// <param name="pos"></param>
public
void
InstantiateDroppedLifeStone
(
Vector2Int
size
,
int
num
,
float
goldPer
,
int
ameNum
,
Vector3
pos
)
{
GameObject
tmpObj
=
Instantiate
(
droppedLifeStonePrefab
);
tmpObj
.
GetComponent
<
DroppedLifeStone
>().
Init
(
CreateLifeStoneInfo
(
size
,
num
,
goldPer
,
ameNum
),
pos
);
}
public
void
InstantiateDroppedLifeStone
(
Vector2Int
size
,
float
goldPer
,
int
ameNum
,
Vector3
pos
)
{
GameObject
tmpObj
=
Instantiate
(
droppedLifeStonePrefab
);
tmpObj
.
GetComponent
<
DroppedLifeStone
>().
Init
(
CreateLifeStoneInfo
(
size
,
goldPer
,
ameNum
),
pos
);
}
public
void
InstantiateDroppedLifeStone
(
int
num
,
float
goldPer
,
int
ameNum
,
Vector3
pos
)
{
GameObject
tmpObj
=
Instantiate
(
droppedLifeStonePrefab
);
tmpObj
.
GetComponent
<
DroppedLifeStone
>().
Init
(
CreateLifeStoneInfo
(
num
,
goldPer
,
ameNum
),
pos
);
}
public
void
InstantiateDroppedLifeStone
(
LifeStoneInfo
info
,
Vector3
pos
)
public
void
InstantiateDroppedLifeStone
(
LifeStoneInfo
info
,
Vector3
pos
)
{
{
GameObject
tmpObj
=
Instantiate
(
droppedLifeStonePrefab
);
GameObject
tmpObj
=
Instantiate
(
droppedLifeStonePrefab
);
tmpObj
.
GetComponent
<
DroppedLifeStone
>().
Init
(
info
,
pos
);
tmpObj
.
GetComponent
<
DroppedLifeStone
>().
Init
(
info
,
pos
);
}
}
/// <summary>
/// Randomize LifeStone by size, num, gold probablity, number of ametyst
/// </summary>
/// <param name="size"></param>
/// <param name="num"></param>
/// <param name="goldPer"></param>
/// <param name="ameNum"></param>
/// <returns></returns>
public
LifeStoneInfo
CreateLifeStoneInfo
(
Vector2Int
size
,
int
num
,
float
goldPer
,
int
ameNum
)
public
LifeStoneInfo
CreateLifeStoneInfo
(
Vector2Int
size
,
int
num
,
float
goldPer
,
int
ameNum
)
{
{
System
.
Random
rnd
=
new
System
.
Random
();
System
.
Random
rnd
=
new
System
.
Random
();
...
@@ -228,7 +229,7 @@ public class LifeStoneManager : MonoBehaviour {
...
@@ -228,7 +229,7 @@ public class LifeStoneManager : MonoBehaviour {
/// push LifeStone in LifeStoneFrame
/// push LifeStone in LifeStoneFrame
/// </summary>
/// </summary>
/// <param name="pushInfo"></param>
/// <param name="pushInfo"></param>
public
void
PushLifeStone
(
LifeStoneInfo
pushInfo
)
public
bool
PushLifeStone
(
LifeStoneInfo
pushInfo
)
{
{
System
.
Random
rnd
=
new
System
.
Random
();
System
.
Random
rnd
=
new
System
.
Random
();
Vector2Int
pSize
=
pushInfo
.
getSize
();
Vector2Int
pSize
=
pushInfo
.
getSize
();
...
@@ -259,6 +260,8 @@ public class LifeStoneManager : MonoBehaviour {
...
@@ -259,6 +260,8 @@ public class LifeStoneManager : MonoBehaviour {
for
(
int
i
=
0
;
i
<=
3
-
pSize
.
x
;
i
++)
for
(
int
i
=
0
;
i
<=
3
-
pSize
.
x
;
i
++)
if
(
minRow
[
i
]
<
selectedRow
)
selectedRow
=
minRow
[
i
];
if
(
minRow
[
i
]
<
selectedRow
)
selectedRow
=
minRow
[
i
];
if
(
selectedRow
==
lifeStoneRowNum
)
return
false
;
for
(
int
i
=
0
;
i
<=
3
-
pSize
.
x
;
i
++)
for
(
int
i
=
0
;
i
<=
3
-
pSize
.
x
;
i
++)
if
(
minRow
[
i
]
==
selectedRow
)
selColCand
.
Add
(
i
);
if
(
minRow
[
i
]
==
selectedRow
)
selColCand
.
Add
(
i
);
...
@@ -319,10 +322,15 @@ public class LifeStoneManager : MonoBehaviour {
...
@@ -319,10 +322,15 @@ public class LifeStoneManager : MonoBehaviour {
}
}
}
}
}
}
return
true
;
}
}
/// <summary>
/// count lifestoneunit in lifestoneframe by type
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public
int
CountType
(
LifeStoneType
type
)
public
int
CountType
(
LifeStoneType
type
)
{
{
int
count
=
0
;
int
count
=
0
;
...
@@ -332,7 +340,25 @@ public class LifeStoneManager : MonoBehaviour {
...
@@ -332,7 +340,25 @@ public class LifeStoneManager : MonoBehaviour {
count
++;
count
++;
return
count
;
return
count
;
}
}
/// <summary>
/// count lifestoneunit in lifestoneframe
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public
int
CountType
()
{
int
count
=
0
;
for
(
int
i
=
0
;
i
<
3
;
i
++)
for
(
int
j
=
0
;
j
<
lifeStoneRowNum
;
j
++)
if
(
lifeStoneArray
[
j
,
i
]
>
0
)
count
++;
return
count
;
}
/// <summary>
/// destroy lifestone by number
/// </summary>
/// <param name="num"></param>
public
void
DestroyStone
(
int
num
)
public
void
DestroyStone
(
int
num
)
{
{
System
.
Random
rnd
=
new
System
.
Random
();
System
.
Random
rnd
=
new
System
.
Random
();
...
@@ -361,6 +387,11 @@ public class LifeStoneManager : MonoBehaviour {
...
@@ -361,6 +387,11 @@ public class LifeStoneManager : MonoBehaviour {
StartCoroutine
(
DestroyInPhase
(
candArray
));
StartCoroutine
(
DestroyInPhase
(
candArray
));
}
}
/// <summary>
/// make term among lifestone destroy
/// </summary>
/// <param name="candArray"></param>
/// <returns></returns>
IEnumerator
DestroyInPhase
(
ArrayList
candArray
)
IEnumerator
DestroyInPhase
(
ArrayList
candArray
)
{
{
for
(
int
i
=
0
;
i
<
candArray
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
candArray
.
Count
;
i
++)
...
@@ -372,6 +403,11 @@ public class LifeStoneManager : MonoBehaviour {
...
@@ -372,6 +403,11 @@ public class LifeStoneManager : MonoBehaviour {
}
}
}
}
/// <summary>
/// change normal lifestone unit to type
/// </summary>
/// <param name="type"></param>
/// <param name="num"></param>
public
void
ChangeFromNormal
(
LifeStoneType
type
,
int
num
)
public
void
ChangeFromNormal
(
LifeStoneType
type
,
int
num
)
{
{
System
.
Random
rnd
=
new
System
.
Random
();
System
.
Random
rnd
=
new
System
.
Random
();
...
@@ -390,6 +426,11 @@ public class LifeStoneManager : MonoBehaviour {
...
@@ -390,6 +426,11 @@ public class LifeStoneManager : MonoBehaviour {
StartCoroutine
(
ChangeInPhase
(
candArray
,(
int
)
type
));
StartCoroutine
(
ChangeInPhase
(
candArray
,(
int
)
type
));
}
}
/// <summary>
/// change type lifestone unit to normal
/// </summary>
/// <param name="type"></param>
/// <param name="num"></param>
public
void
ChangeToNormal
(
LifeStoneType
type
,
int
num
)
public
void
ChangeToNormal
(
LifeStoneType
type
,
int
num
)
{
{
System
.
Random
rnd
=
new
System
.
Random
();
System
.
Random
rnd
=
new
System
.
Random
();
...
@@ -408,6 +449,12 @@ public class LifeStoneManager : MonoBehaviour {
...
@@ -408,6 +449,12 @@ public class LifeStoneManager : MonoBehaviour {
StartCoroutine
(
ChangeInPhase
(
candArray
,
1
));
StartCoroutine
(
ChangeInPhase
(
candArray
,
1
));
}
}
/// <summary>
/// make term among changing
/// </summary>
/// <param name="candArray"></param>
/// <param name="type"></param>
/// <returns></returns>
IEnumerator
ChangeInPhase
(
ArrayList
candArray
,
int
type
)
IEnumerator
ChangeInPhase
(
ArrayList
candArray
,
int
type
)
{
{
System
.
Random
rnd
=
new
System
.
Random
();
System
.
Random
rnd
=
new
System
.
Random
();
...
@@ -421,9 +468,14 @@ public class LifeStoneManager : MonoBehaviour {
...
@@ -421,9 +468,14 @@ public class LifeStoneManager : MonoBehaviour {
}
}
}
}
/// <summary>
/// lifestoneframe vibration
/// </summary>
/// <param name="vibration">strength of vibration</param>
/// <returns></returns>
public
IEnumerator
VibrateEnumerator
(
float
vibration
)
public
IEnumerator
VibrateEnumerator
(
float
vibration
)
{
{
while
(
vibration
>
lifeStoneSize
*
0.05f
)
while
(
vibration
>
lifeStoneSize
*
0.0
0
5f
)
{
{
Vector2
tmpVector
=
Random
.
insideUnitCircle
;
Vector2
tmpVector
=
Random
.
insideUnitCircle
;
transform
.
position
=
new
Vector3
(
lifeStoneLocation
.
x
+
tmpVector
.
x
*
vibration
*
0.3f
,
lifeStoneLocation
.
y
+
tmpVector
.
y
*
vibration
,
0
);
transform
.
position
=
new
Vector3
(
lifeStoneLocation
.
x
+
tmpVector
.
x
*
vibration
*
0.3f
,
lifeStoneLocation
.
y
+
tmpVector
.
y
*
vibration
,
0
);
...
...
Assets/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneTest.cs
View file @
21de9755
...
@@ -18,7 +18,7 @@ public class LifeStoneTest : MonoBehaviour {
...
@@ -18,7 +18,7 @@ public class LifeStoneTest : MonoBehaviour {
public
void
push
()
public
void
push
()
{
{
uii
.
PushLifeStone
(
uii
.
CreateLifeStoneInfo
(
Convert
.
ToInt32
(
numText
.
GetComponent
<
InputField
>().
text
),
Convert
.
ToSingle
(
goldPerText
.
GetComponent
<
InputField
>().
text
),
Convert
.
ToInt32
(
ameNumText
.
GetComponent
<
InputField
>().
text
))
);
uii
.
InstantiateDroppedLifeStone
(
Convert
.
ToInt32
(
numText
.
GetComponent
<
InputField
>().
text
),
Convert
.
ToSingle
(
goldPerText
.
GetComponent
<
InputField
>().
text
),
Convert
.
ToInt32
(
ameNumText
.
GetComponent
<
InputField
>().
text
),
GameObject
.
Find
(
"Player"
).
transform
.
position
);
}
}
public
void
gold
()
public
void
gold
()
{
{
...
...
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