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
2395cbda
Commit
2395cbda
authored
Feb 07, 2019
by
18류지석
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
아이템 생명석 포션 튀어나오는거 만듦
parent
f015c152
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
98 additions
and
50 deletions
+98
-50
DroppedItem.prefab
Assets/Prefabs/UI/In-Game UI/InventoryUI/DroppedItem.prefab
+1
-1
InventoryManager.prefab
...Prefabs/UI/In-Game UI/InventoryUI/InventoryManager.prefab
+2
-2
LifeStoneUI.prefab
Assets/Prefabs/UI/In-Game UI/LifeStoneUI.prefab
+2
-0
goldPotion.prefab
Assets/Prefabs/UI/In-Game UI/LifeStoneUI/goldPotion.prefab
+2
-2
Enemy.cs
Assets/Scripts/Characters/Enemy.cs
+1
-1
DroppedItem.cs
Assets/Scripts/Item/DroppedItem.cs
+1
-1
InventoryManager.cs
Assets/Scripts/Item/InventoryManager.cs
+43
-33
LifeStoneManager.cs
...Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
+42
-8
LifeStoneTest.cs
...ts/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneTest.cs
+2
-2
TagManager.asset
ProjectSettings/TagManager.asset
+2
-0
No files found.
Assets/Prefabs/UI/In-Game UI/InventoryUI/DroppedItem.prefab
View file @
2395cbda
...
@@ -91,7 +91,7 @@ Rigidbody2D:
...
@@ -91,7 +91,7 @@ Rigidbody2D:
m_Material
:
{
fileID
:
0
}
m_Material
:
{
fileID
:
0
}
m_Interpolate
:
0
m_Interpolate
:
0
m_SleepingMode
:
1
m_SleepingMode
:
1
m_CollisionDetection
:
0
m_CollisionDetection
:
1
m_Constraints
:
4
m_Constraints
:
4
---
!u!61
&61781846804253628
---
!u!61
&61781846804253628
BoxCollider2D
:
BoxCollider2D
:
...
...
Assets/Prefabs/UI/In-Game UI/InventoryUI/InventoryManager.prefab
View file @
2395cbda
...
@@ -51,7 +51,7 @@ MonoBehaviour:
...
@@ -51,7 +51,7 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
674793b622d7c184882dfeb8784bbf92
,
type
:
3
}
m_Script
:
{
fileID
:
11500000
,
guid
:
674793b622d7c184882dfeb8784bbf92
,
type
:
3
}
m_Name
:
m_Name
:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
itemPool
:
[]
addonPool
:
[]
droppedPrefab
:
{
fileID
:
1610049888013262
,
guid
:
ee63f05b79e18ce4bad2c226aa70a28e
,
droppedPrefab
:
{
fileID
:
1610049888013262
,
guid
:
ee63f05b79e18ce4bad2c226aa70a28e
,
type
:
2
}
type
:
2
}
popoutStrengthMultiplier
:
4
popoutTime
:
0.3
Assets/Prefabs/UI/In-Game UI/LifeStoneUI.prefab
View file @
2395cbda
...
@@ -99,6 +99,8 @@ MonoBehaviour:
...
@@ -99,6 +99,8 @@ MonoBehaviour:
droppedLifeStonePrefab
:
{
fileID
:
1149595688849768
,
guid
:
8255a117a93935941b32b4aed9b299a0
,
droppedLifeStonePrefab
:
{
fileID
:
1149595688849768
,
guid
:
8255a117a93935941b32b4aed9b299a0
,
type
:
2
}
type
:
2
}
frameBorder
:
0.2
frameBorder
:
0.2
popoutStrengthMultiplier
:
3
popoutTime
:
0.3
---
!u!224
&224255635903845628
---
!u!224
&224255635903845628
RectTransform
:
RectTransform
:
m_ObjectHideFlags
:
1
m_ObjectHideFlags
:
1
...
...
Assets/Prefabs/UI/In-Game UI/LifeStoneUI/goldPotion.prefab
View file @
2395cbda
...
@@ -26,7 +26,7 @@ GameObject:
...
@@ -26,7 +26,7 @@ GameObject:
m_Icon
:
{
fileID
:
0
}
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
m_IsActive
:
0
---
!u!1
&1778675533210814
---
!u!1
&1778675533210814
GameObject
:
GameObject
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -91,7 +91,7 @@ Rigidbody2D:
...
@@ -91,7 +91,7 @@ Rigidbody2D:
m_Material
:
{
fileID
:
0
}
m_Material
:
{
fileID
:
0
}
m_Interpolate
:
0
m_Interpolate
:
0
m_SleepingMode
:
1
m_SleepingMode
:
1
m_CollisionDetection
:
0
m_CollisionDetection
:
1
m_Constraints
:
4
m_Constraints
:
4
---
!u!61
&61337180976087290
---
!u!61
&61337180976087290
BoxCollider2D
:
BoxCollider2D
:
...
...
Assets/Scripts/Characters/Enemy.cs
View file @
2395cbda
...
@@ -94,7 +94,7 @@ public class Enemy : MonoBehaviour {
...
@@ -94,7 +94,7 @@ public class Enemy : MonoBehaviour {
break
;
break
;
}
}
}
}
inventoryManager
.
ItemInstantiate
(
enemyManager
.
dropItemList
[
indexOfItem
],
transform
.
parent
.
position
);
inventoryManager
.
ItemInstantiate
(
enemyManager
.
dropItemList
[
indexOfItem
],
transform
.
parent
.
position
,
1f
);
gameObject
.
SetActive
(
false
);
gameObject
.
SetActive
(
false
);
// animator.SetTrigger("DeadTrigger");
// animator.SetTrigger("DeadTrigger");
...
...
Assets/Scripts/Item/DroppedItem.cs
View file @
2395cbda
...
@@ -9,7 +9,7 @@ public class DroppedItem : MonoBehaviour, IPlayerInteraction
...
@@ -9,7 +9,7 @@ public class DroppedItem : MonoBehaviour, IPlayerInteraction
public
Item
item
;
public
Item
item
;
public
Addon
addon
;
public
Addon
addon
;
public
GameObject
highlight
;
public
GameObject
highlight
;
float
itemSizeMultiplier
=
0.007
7
f
;
float
itemSizeMultiplier
=
0.007f
;
Rigidbody2D
rb2D
;
Rigidbody2D
rb2D
;
BoxCollider2D
bc2D
;
BoxCollider2D
bc2D
;
SpriteRenderer
sprt
;
SpriteRenderer
sprt
;
...
...
Assets/Scripts/Item/InventoryManager.cs
View file @
2395cbda
...
@@ -10,6 +10,8 @@ public class InventoryManager : MonoBehaviour {
...
@@ -10,6 +10,8 @@ public class InventoryManager : MonoBehaviour {
public
List
<
string
>[]
itemPool
=
new
List
<
string
>[
4
];
public
List
<
string
>[]
itemPool
=
new
List
<
string
>[
4
];
public
List
<
string
>[]
addonPool
=
new
List
<
string
>[
4
];
public
List
<
string
>[]
addonPool
=
new
List
<
string
>[
4
];
public
GameObject
droppedPrefab
;
public
GameObject
droppedPrefab
;
public
float
popoutStrengthMultiplier
;
public
float
popoutTime
;
GameObject
player
;
GameObject
player
;
private
void
Start
()
private
void
Start
()
...
@@ -83,45 +85,48 @@ public class InventoryManager : MonoBehaviour {
...
@@ -83,45 +85,48 @@ public class InventoryManager : MonoBehaviour {
IEnumerator
TestCoroutine
()
IEnumerator
TestCoroutine
()
{
{
yield
return
null
;
yield
return
null
;
ItemInstantiate
(
ItemQuality
.
Study
,
player
.
transform
.
position
);
yield
return
new
WaitForSeconds
(
2.5f
);
/*PushItem((Item)System.Activator.CreateInstance(System.Type.GetType(itemPool[0])));
ItemInstantiate
(
ItemQuality
.
Study
,
player
.
transform
.
position
,
1f
);
PushItem((Item)System.Activator.CreateInstance(System.Type.GetType(itemPool[2])));
yield return new WaitForSeconds(1.5f);
}
ItemInstantiate(itemPool[0], player.transform.position);
yield return new WaitForSeconds(1.5f);
IEnumerator
PopoutCoroutine
(
GameObject
obj
)
ItemInstantiate(itemPool[1], player.transform.position);
{
yield return new WaitForSeconds(1.5f);
float
endTime
=
Time
.
time
+
popoutTime
;
ItemInstantiate(itemPool[2], player.transform.position);
Vector2
orgScale
=
obj
.
transform
.
localScale
;
yield return new WaitForSeconds(1.5f);
SpriteRenderer
[]
sprtArr
=
obj
.
GetComponents
<
SpriteRenderer
>();
ItemInstantiate(itemPool[3], player.transform.position);
yield return new WaitForSeconds(1.5f);
while
(
Time
.
time
<
endTime
)
AddonInstantiate(addonPool[0], player.transform.position);
{
yield return new WaitForSeconds(1.5f);
obj
.
transform
.
localScale
=
(
1
-
((
endTime
-
Time
.
time
)
/
popoutTime
))
*
orgScale
;
AddonInstantiate(addonPool[1], player.transform.position);
foreach
(
SpriteRenderer
sprt
in
sprtArr
)
ItemSelect(0);
sprt
.
color
=
new
Color
(
sprt
.
color
.
r
,
sprt
.
color
.
g
,
sprt
.
color
.
b
,
1
-
((
endTime
-
Time
.
time
)
/
popoutTime
));
yield return new WaitForSeconds(1f);
yield
return
null
;
PushItem((Item)System.Activator.CreateInstance(System.Type.GetType(itemPool[1])));
}
yield return new WaitForSeconds(1f);
PushItem((Item)System.Activator.CreateInstance(System.Type.GetType(itemPool[2])));
obj
.
transform
.
localScale
=
orgScale
;
yield return new WaitForSeconds(1f);
foreach
(
SpriteRenderer
sprt
in
sprtArr
)
PushAddon((Addon)System.Activator.CreateInstance(System.Type.GetType(addonPool[0])));
sprt
.
color
=
new
Color
(
sprt
.
color
.
r
,
sprt
.
color
.
g
,
sprt
.
color
.
b
,
1f
);
yield return new WaitForSeconds(1f);
PushAddon((Addon)System.Activator.CreateInstance(System.Type.GetType(addonPool[1])));
yield return new WaitForSeconds(1f);
AttachAddon(0, 0);
yield return new WaitForSeconds(1f);
*/
}
}
void
PopoutGenerator
(
GameObject
obj
,
float
popoutStrength
)
{
popoutStrength
*=
popoutStrengthMultiplier
;
float
angle
=
Mathf
.
Deg2Rad
*
Random
.
Range
(
60f
,
120f
);
obj
.
GetComponent
<
Rigidbody2D
>().
velocity
=
new
Vector2
(
Mathf
.
Cos
(
angle
),
Mathf
.
Sin
(
angle
))
*
popoutStrength
;
StartCoroutine
(
PopoutCoroutine
(
obj
));
}
/// <summary>
/// <summary>
/// Instantiate random item by quality
/// Instantiate random item by quality
/// </summary>
/// </summary>
/// <param name="quality"></param>
/// <param name="quality"></param>
/// <param name="pos"></param>
/// <param name="pos"></param>
public
void
ItemInstantiate
(
ItemQuality
quality
,
Vector3
pos
)
/// <param name="popoutStrength">0:no popout, 1:normal popout</param>
public
void
ItemInstantiate
(
ItemQuality
quality
,
Vector3
pos
,
float
popoutStrength
)
{
{
if
(
itemPool
[(
int
)
quality
].
Count
>
0
)
if
(
itemPool
[(
int
)
quality
].
Count
>
0
)
{
{
ItemInstantiate
(
itemPool
[(
int
)
quality
][
0
],
pos
);
ItemInstantiate
(
itemPool
[(
int
)
quality
][
0
],
pos
,
popoutStrength
);
itemPool
[(
int
)
quality
].
RemoveAt
(
0
);
itemPool
[(
int
)
quality
].
RemoveAt
(
0
);
}
}
}
}
...
@@ -130,21 +135,24 @@ public class InventoryManager : MonoBehaviour {
...
@@ -130,21 +135,24 @@ public class InventoryManager : MonoBehaviour {
/// </summary>
/// </summary>
/// <param name="str"></param>
/// <param name="str"></param>
/// <param name="pos"></param>
/// <param name="pos"></param>
public
void
ItemInstantiate
(
string
str
,
Vector3
pos
)
public
void
ItemInstantiate
(
string
str
,
Vector3
pos
,
float
popoutStrength
)
{
{
GameObject
tmpItem
=
Instantiate
(
droppedPrefab
);
GameObject
tmpItem
=
Instantiate
(
droppedPrefab
);
tmpItem
.
GetComponent
<
DroppedItem
>().
Init
((
Item
)
System
.
Activator
.
CreateInstance
(
System
.
Type
.
GetType
(
str
)),
pos
);
tmpItem
.
GetComponent
<
DroppedItem
>().
Init
((
Item
)
System
.
Activator
.
CreateInstance
(
System
.
Type
.
GetType
(
str
)),
pos
);
PopoutGenerator
(
tmpItem
,
popoutStrength
);
}
}
/// <summary>
/// <summary>
/// Instantiate item by Item Instance on pos
/// Instantiate item by Item Instance on pos
/// </summary>
/// </summary>
/// <param name="item"></param>
/// <param name="item"></param>
/// <param name="pos"></param>
/// <param name="pos"></param>
public
void
ItemInstantiate
(
Item
item
,
Vector3
pos
)
public
void
ItemInstantiate
(
Item
item
,
Vector3
pos
,
float
popoutStrength
)
{
{
GameObject
tmpItem
=
Instantiate
(
droppedPrefab
);
GameObject
tmpItem
=
Instantiate
(
droppedPrefab
);
tmpItem
.
GetComponent
<
DroppedItem
>().
Init
(
item
,
pos
);
tmpItem
.
GetComponent
<
DroppedItem
>().
Init
(
item
,
pos
);
PopoutGenerator
(
tmpItem
,
popoutStrength
);
}
}
/// <summary>
/// <summary>
/// Instantiate random addon by quality
/// Instantiate random addon by quality
/// </summary>
/// </summary>
...
@@ -178,6 +186,7 @@ public class InventoryManager : MonoBehaviour {
...
@@ -178,6 +186,7 @@ public class InventoryManager : MonoBehaviour {
GameObject
tmpItem
=
Instantiate
(
droppedPrefab
);
GameObject
tmpItem
=
Instantiate
(
droppedPrefab
);
tmpItem
.
GetComponent
<
DroppedItem
>().
Init
(
addon
,
pos
);
tmpItem
.
GetComponent
<
DroppedItem
>().
Init
(
addon
,
pos
);
}
}
/// <summary>
/// <summary>
/// reset inventory canvas
/// reset inventory canvas
/// </summary>
/// </summary>
...
@@ -185,6 +194,7 @@ public class InventoryManager : MonoBehaviour {
...
@@ -185,6 +194,7 @@ public class InventoryManager : MonoBehaviour {
{
{
ui
.
SetOnPosition
(
itemList
,
addonList
);
ui
.
SetOnPosition
(
itemList
,
addonList
);
}
}
/// <summary>
/// <summary>
/// call when item has been clicked
/// call when item has been clicked
/// </summary>
/// </summary>
...
@@ -234,7 +244,7 @@ public class InventoryManager : MonoBehaviour {
...
@@ -234,7 +244,7 @@ public class InventoryManager : MonoBehaviour {
{
{
if
(
itemList
.
Count
>
index
)
if
(
itemList
.
Count
>
index
)
{
{
ItemInstantiate
(
itemList
[
index
],
player
.
transform
.
position
);
ItemInstantiate
(
itemList
[
index
],
player
.
transform
.
position
,
1f
);
itemList
.
RemoveAt
(
index
);
itemList
.
RemoveAt
(
index
);
if
(
index
==
ui
.
selectedItem
)
if
(
index
==
ui
.
selectedItem
)
ui
.
selectedItem
=
-
1
;
ui
.
selectedItem
=
-
1
;
...
...
Assets/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
View file @
2395cbda
...
@@ -58,7 +58,10 @@ public class LifeStoneManager : MonoBehaviour {
...
@@ -58,7 +58,10 @@ public class LifeStoneManager : MonoBehaviour {
public
float
frameBorder
;
public
float
frameBorder
;
void
Start
()
{
public
float
popoutStrengthMultiplier
;
public
float
popoutTime
;
void
Start
()
{
transform
.
position
=
new
Vector3
(
lifeStoneLocation
.
x
,
lifeStoneLocation
.
y
,
0
);
transform
.
position
=
new
Vector3
(
lifeStoneLocation
.
x
,
lifeStoneLocation
.
y
,
0
);
frameSuper
.
GetComponent
<
LifeStoneFrame
>().
Init
(
frameSuper
.
transform
,
standardImage
,
lifeStoneRowNum
,
lifeStoneSize
,
sprites
,
frameBorder
);
frameSuper
.
GetComponent
<
LifeStoneFrame
>().
Init
(
frameSuper
.
transform
,
standardImage
,
lifeStoneRowNum
,
lifeStoneSize
,
sprites
,
frameBorder
);
lifeStoneArray
=
new
int
[
50
,
3
];
lifeStoneArray
=
new
int
[
50
,
3
];
...
@@ -84,9 +87,35 @@ public class LifeStoneManager : MonoBehaviour {
...
@@ -84,9 +87,35 @@ public class LifeStoneManager : MonoBehaviour {
frameSuper
.
GetComponent
<
LifeStoneFrame
>().
AddRow
(
lifeStoneRowNum
);
frameSuper
.
GetComponent
<
LifeStoneFrame
>().
AddRow
(
lifeStoneRowNum
);
}
}
public
void
InstantiatePotion
(
Vector3
pos
)
public
void
InstantiatePotion
(
Vector3
pos
,
float
popoutStrength
)
{
PopoutGenerator
(
Instantiate
(
goldPotionPrefab
,
pos
,
Quaternion
.
identity
),
popoutStrength
);
}
IEnumerator
PopoutCoroutine
(
GameObject
obj
)
{
float
endTime
=
Time
.
time
+
popoutTime
;
Vector2
orgScale
=
obj
.
transform
.
localScale
;
SpriteRenderer
[]
sprtArr
=
obj
.
GetComponents
<
SpriteRenderer
>();
while
(
Time
.
time
<
endTime
)
{
obj
.
transform
.
localScale
=
(
1
-
((
endTime
-
Time
.
time
)
/
popoutTime
))
*
orgScale
;
foreach
(
SpriteRenderer
sprt
in
sprtArr
)
sprt
.
color
=
new
Color
(
sprt
.
color
.
r
,
sprt
.
color
.
g
,
sprt
.
color
.
b
,
1
-
((
endTime
-
Time
.
time
)
/
popoutTime
));
yield
return
null
;
}
obj
.
transform
.
localScale
=
orgScale
;
foreach
(
SpriteRenderer
sprt
in
sprtArr
)
sprt
.
color
=
new
Color
(
sprt
.
color
.
r
,
sprt
.
color
.
g
,
sprt
.
color
.
b
,
1f
);
}
void
PopoutGenerator
(
GameObject
obj
,
float
popoutStrength
)
{
{
Instantiate
(
goldPotionPrefab
,
pos
,
Quaternion
.
identity
);
popoutStrength
*=
popoutStrengthMultiplier
;
float
angle
=
Mathf
.
Deg2Rad
*
Random
.
Range
(
60f
,
120f
);
obj
.
GetComponent
<
Rigidbody2D
>().
velocity
=
new
Vector2
(
Mathf
.
Cos
(
angle
),
Mathf
.
Sin
(
angle
))
*
popoutStrength
;
StartCoroutine
(
PopoutCoroutine
(
obj
));
}
}
/// <summary>
/// <summary>
...
@@ -94,25 +123,29 @@ public class LifeStoneManager : MonoBehaviour {
...
@@ -94,25 +123,29 @@ public class LifeStoneManager : MonoBehaviour {
/// </summary>
/// </summary>
/// <param name="info"></param>
/// <param name="info"></param>
/// <param name="pos"></param>
/// <param name="pos"></param>
public
void
InstantiateDroppedLifeStone
(
Vector2Int
size
,
int
num
,
float
goldPer
,
int
ameNum
,
Vector3
pos
)
public
void
InstantiateDroppedLifeStone
(
Vector2Int
size
,
int
num
,
float
goldPer
,
int
ameNum
,
Vector3
pos
,
float
popoutStrength
)
{
{
GameObject
tmpObj
=
Instantiate
(
droppedLifeStonePrefab
);
GameObject
tmpObj
=
Instantiate
(
droppedLifeStonePrefab
);
tmpObj
.
GetComponent
<
DroppedLifeStone
>().
Init
(
CreateLifeStoneInfo
(
size
,
num
,
goldPer
,
ameNum
),
pos
);
tmpObj
.
GetComponent
<
DroppedLifeStone
>().
Init
(
CreateLifeStoneInfo
(
size
,
num
,
goldPer
,
ameNum
),
pos
);
PopoutGenerator
(
tmpObj
,
popoutStrength
);
}
}
public
void
InstantiateDroppedLifeStone
(
Vector2Int
size
,
float
goldPer
,
int
ameNum
,
Vector3
pos
)
public
void
InstantiateDroppedLifeStone
(
Vector2Int
size
,
float
goldPer
,
int
ameNum
,
Vector3
pos
,
float
popoutStrength
)
{
{
GameObject
tmpObj
=
Instantiate
(
droppedLifeStonePrefab
);
GameObject
tmpObj
=
Instantiate
(
droppedLifeStonePrefab
);
tmpObj
.
GetComponent
<
DroppedLifeStone
>().
Init
(
CreateLifeStoneInfo
(
size
,
goldPer
,
ameNum
),
pos
);
tmpObj
.
GetComponent
<
DroppedLifeStone
>().
Init
(
CreateLifeStoneInfo
(
size
,
goldPer
,
ameNum
),
pos
);
PopoutGenerator
(
tmpObj
,
popoutStrength
);
}
}
public
void
InstantiateDroppedLifeStone
(
int
num
,
float
goldPer
,
int
ameNum
,
Vector3
pos
)
public
void
InstantiateDroppedLifeStone
(
int
num
,
float
goldPer
,
int
ameNum
,
Vector3
pos
,
float
popoutStrength
)
{
{
GameObject
tmpObj
=
Instantiate
(
droppedLifeStonePrefab
);
GameObject
tmpObj
=
Instantiate
(
droppedLifeStonePrefab
);
tmpObj
.
GetComponent
<
DroppedLifeStone
>().
Init
(
CreateLifeStoneInfo
(
num
,
goldPer
,
ameNum
),
pos
);
tmpObj
.
GetComponent
<
DroppedLifeStone
>().
Init
(
CreateLifeStoneInfo
(
num
,
goldPer
,
ameNum
),
pos
);
PopoutGenerator
(
tmpObj
,
popoutStrength
);
}
}
public
void
InstantiateDroppedLifeStone
(
LifeStoneInfo
info
,
Vector3
pos
)
public
void
InstantiateDroppedLifeStone
(
LifeStoneInfo
info
,
Vector3
pos
,
float
popoutStrength
)
{
{
GameObject
tmpObj
=
Instantiate
(
droppedLifeStonePrefab
);
GameObject
tmpObj
=
Instantiate
(
droppedLifeStonePrefab
);
tmpObj
.
GetComponent
<
DroppedLifeStone
>().
Init
(
info
,
pos
);
tmpObj
.
GetComponent
<
DroppedLifeStone
>().
Init
(
info
,
pos
);
PopoutGenerator
(
tmpObj
,
popoutStrength
);
}
}
/// <summary>
/// <summary>
...
@@ -324,7 +357,8 @@ public class LifeStoneManager : MonoBehaviour {
...
@@ -324,7 +357,8 @@ public class LifeStoneManager : MonoBehaviour {
}
}
InstantiateDroppedLifeStone
(
CreateLifeStoneInfo
(
InstantiateDroppedLifeStone
(
CreateLifeStoneInfo
(
new
LifeStoneInfo
(
new
Vector2Int
(
pSize
.
x
,
pSize
.
y
-
cutRow
),
new
string
(
newFill
))),
new
LifeStoneInfo
(
new
Vector2Int
(
pSize
.
x
,
pSize
.
y
-
cutRow
),
new
string
(
newFill
))),
GameObject
.
Find
(
"Player"
).
transform
.
position
+
new
Vector3
(
droppedLifeStonePrefab
.
GetComponent
<
DroppedLifeStone
>().
unitSprite
.
GetComponent
<
SpriteRenderer
>().
bounds
.
size
.
x
*
i
,
0
,
0
));
GameObject
.
Find
(
"Player"
).
transform
.
position
+
new
Vector3
(
droppedLifeStonePrefab
.
GetComponent
<
DroppedLifeStone
>().
unitSprite
.
GetComponent
<
SpriteRenderer
>().
bounds
.
size
.
x
*
i
,
0
,
0
),
1f
);
}
}
}
}
}
}
...
...
Assets/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneTest.cs
View file @
2395cbda
...
@@ -18,7 +18,7 @@ public class LifeStoneTest : MonoBehaviour {
...
@@ -18,7 +18,7 @@ public class LifeStoneTest : MonoBehaviour {
public
void
push
()
public
void
push
()
{
{
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
);
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
,
1f
);
}
}
public
void
gold
()
public
void
gold
()
{
{
...
@@ -42,6 +42,6 @@ public class LifeStoneTest : MonoBehaviour {
...
@@ -42,6 +42,6 @@ public class LifeStoneTest : MonoBehaviour {
}
}
public
void
goldPotion
()
public
void
goldPotion
()
{
{
uii
.
InstantiatePotion
(
GameObject
.
Find
(
"Player"
).
transform
.
position
);
uii
.
InstantiatePotion
(
GameObject
.
Find
(
"Player"
).
transform
.
position
,
1f
);
}
}
}
}
ProjectSettings/TagManager.asset
View file @
2395cbda
...
@@ -9,6 +9,8 @@ TagManager:
...
@@ -9,6 +9,8 @@ TagManager:
-
TetriminoSpawner
-
TetriminoSpawner
-
DroppedLifeStone
-
DroppedLifeStone
-
DroppedItem
-
DroppedItem
-
Enemy
-
DroppedPotion
layers
:
layers
:
-
Default
-
Default
-
TransparentFX
-
TransparentFX
...
...
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