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
8c7056b5
Commit
8c7056b5
authored
Feb 07, 2019
by
18류지석
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
실수로 애드온은 안튀어나옴. 이제 튀어나온다
parent
2395cbda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
InventoryManager.cs
Assets/Scripts/Item/InventoryManager.cs
+8
-6
No files found.
Assets/Scripts/Item/InventoryManager.cs
View file @
8c7056b5
...
...
@@ -158,11 +158,11 @@ public class InventoryManager : MonoBehaviour {
/// </summary>
/// <param name="quality"></param>
/// <param name="pos"></param>
public
void
AddonInstantiate
(
ItemQuality
quality
,
Vector3
pos
)
public
void
AddonInstantiate
(
ItemQuality
quality
,
Vector3
pos
,
float
popoutStrength
)
{
if
(
addonPool
[(
int
)
quality
].
Count
>
0
)
{
AddonInstantiate
(
addonPool
[(
int
)
quality
][
0
],
pos
);
AddonInstantiate
(
addonPool
[(
int
)
quality
][
0
],
pos
,
popoutStrength
);
addonPool
[(
int
)
quality
].
RemoveAt
(
0
);
}
}
...
...
@@ -171,20 +171,22 @@ public class InventoryManager : MonoBehaviour {
/// </summary>
/// <param name="str"></param>
/// <param name="pos"></param>
public
void
AddonInstantiate
(
string
str
,
Vector3
pos
)
public
void
AddonInstantiate
(
string
str
,
Vector3
pos
,
float
popoutStrength
)
{
GameObject
tmpItem
=
Instantiate
(
droppedPrefab
);
tmpItem
.
GetComponent
<
DroppedItem
>().
Init
((
Addon
)
System
.
Activator
.
CreateInstance
(
System
.
Type
.
GetType
(
str
)),
pos
);
PopoutGenerator
(
tmpItem
,
popoutStrength
);
}
/// <summary>
/// Instantiate addon by Addon Instance on pos
/// </summary>
/// <param name="item"></param>
/// <param name="pos"></param>
public
void
AddonInstantiate
(
Addon
addon
,
Vector3
pos
)
public
void
AddonInstantiate
(
Addon
addon
,
Vector3
pos
,
float
popoutStrength
)
{
GameObject
tmpItem
=
Instantiate
(
droppedPrefab
);
tmpItem
.
GetComponent
<
DroppedItem
>().
Init
(
addon
,
pos
);
PopoutGenerator
(
tmpItem
,
popoutStrength
);
}
/// <summary>
...
...
@@ -259,7 +261,7 @@ public class InventoryManager : MonoBehaviour {
{
if
(
addonList
.
Count
>
index
)
{
AddonInstantiate
(
addonList
[
index
],
player
.
transform
.
position
);
AddonInstantiate
(
addonList
[
index
],
player
.
transform
.
position
,
1f
);
addonList
.
RemoveAt
(
index
);
}
ui
.
SetOnPosition
(
itemList
,
addonList
);
...
...
@@ -273,7 +275,7 @@ public class InventoryManager : MonoBehaviour {
{
if
(
itemList
[
itemIndex
].
addons
[(
int
)
addonType
]
!=
null
)
{
AddonInstantiate
(
itemList
[
itemIndex
].
addons
[(
int
)
addonType
],
player
.
transform
.
position
);
AddonInstantiate
(
itemList
[
itemIndex
].
addons
[(
int
)
addonType
],
player
.
transform
.
position
,
1f
);
itemList
[
itemIndex
].
addons
[(
int
)
addonType
]
=
null
;
}
ui
.
SetOnPosition
(
itemList
,
addonList
);
...
...
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