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
ba73c3c7
Commit
ba73c3c7
authored
Feb 13, 2019
by
18김상언
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
인벤토리에서 아이템 정보창에서 아이템 설명 뜨는거 만드는중.
parent
6c9e5bfa
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
5488 additions
and
1789 deletions
+5488
-1789
InventoryCanvas.prefab
.../Prefabs/UI/In-Game UI/InventoryUI/InventoryCanvas.prefab
+5457
-1788
AddonDrag.cs
Assets/Scripts/Item/AddonDrag.cs
+18
-1
InventoryManager.cs
Assets/Scripts/Item/InventoryManager.cs
+1
-0
InventoryUI.cs
Assets/Scripts/Item/InventoryUI.cs
+5
-0
Item.cs
Assets/Scripts/Item/Item.cs
+5
-0
Dagger.cs
Assets/Scripts/Item/Items/Dagger.cs
+2
-0
No files found.
Assets/Prefabs/UI/In-Game UI/InventoryUI/InventoryCanvas.prefab
View file @
ba73c3c7
This diff is collapsed.
Click to expand it.
Assets/Scripts/Item/AddonDrag.cs
View file @
ba73c3c7
...
...
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using
UnityEngine
;
using
UnityEngine.EventSystems
;
public
class
AddonDrag
:
MonoBehaviour
,
IBeginDragHandler
,
IDragHandler
,
IEndDragHandler
public
class
AddonDrag
:
MonoBehaviour
,
IBeginDragHandler
,
IDragHandler
,
IEndDragHandler
,
IPointerClickHandler
{
public
int
num
;
InventoryUI
ui
;
...
...
@@ -56,6 +56,23 @@ public class AddonDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDra
}
manager
.
SetOnPosition
();
}
public
void
OnPointerClick
(
PointerEventData
eventData
)
{
if
(
num
<
9
)
{
int
type
=
(
int
)
manager
.
addonList
[
num
].
type
;
if
(
ui
.
selectedItem
!=
-
1
&&
manager
.
itemList
[
ui
.
selectedItem
].
attachable
[
type
])
{
if
(
manager
.
itemList
[
ui
.
selectedItem
].
addons
[
type
]
!=
null
)
manager
.
DetachAddon
(
ui
.
selectedItem
,
(
AddonType
)
type
);
manager
.
AttachAddon
(
ui
.
selectedItem
,
num
);
}
}
else
manager
.
DetachAddon
(
ui
.
selectedItem
,
(
AddonType
)(
num
-
9
));
manager
.
SetOnPosition
();
}
bool
CheckBetween
(
Vector3
mouse
,
Vector3
center
,
Vector2
size
)
{
return
Mathf
.
Abs
(
mouse
.
x
-
center
.
x
)
<=
size
.
x
/
2f
&&
Mathf
.
Abs
(
mouse
.
y
-
center
.
y
)
<=
size
.
y
/
2f
;
...
...
Assets/Scripts/Item/InventoryManager.cs
View file @
ba73c3c7
...
...
@@ -24,6 +24,7 @@ public class InventoryManager : MonoBehaviour {
SetPool
();
ItemInstantiate
(
"Dagger"
,
player
.
transform
.
position
,
0f
);
AddonInstantiate
(
"ParchmentPiece"
,
player
.
transform
.
position
,
0f
);
StartCoroutine
(
TestCoroutine
());
}
...
...
Assets/Scripts/Item/InventoryUI.cs
View file @
ba73c3c7
...
...
@@ -30,6 +30,7 @@ public class InventoryUI : MonoBehaviour {
public
GameObject
[]
infoAddonsFrame
;
public
GameObject
[]
comboStringFrame
;
public
GameObject
[]
comboCharPrefab
;
public
GameObject
[]
comboNameFrame
;
public
float
pixelBetweenChar
;
GameObject
[,]
comboChars
=
new
GameObject
[
3
,
8
];
GameObject
[]
infoAddons
;
...
...
@@ -65,6 +66,7 @@ public class InventoryUI : MonoBehaviour {
comboChars
[
i
,
j
].
SetActive
(
false
);
}
comboStringFrame
[
i
].
SetActive
(
false
);
comboNameFrame
[
i
].
SetActive
(
false
);
}
infoSpace
.
transform
.
Find
(
"Frame"
).
gameObject
.
SetActive
(
false
);
...
...
@@ -100,11 +102,13 @@ public class InventoryUI : MonoBehaviour {
frameObj
.
transform
.
Find
(
"ItemSprite"
).
gameObject
.
GetComponent
<
Image
>().
sprite
=
itemFrameQuality
[(
int
)
itemList
[
selectedItem
].
quality
];
frameObj
.
transform
.
Find
(
"ItemSprite"
).
Find
(
"Sprite"
).
gameObject
.
GetComponent
<
Image
>().
sprite
=
itemList
[
selectedItem
].
sprite
;
frameObj
.
transform
.
Find
(
"ItemSprite"
).
Find
(
"Sprite"
).
gameObject
.
GetComponent
<
RectTransform
>().
sizeDelta
=
itemList
[
selectedItem
].
sizeInventory
;
frameObj
.
transform
.
Find
(
"ItemDescription"
).
gameObject
.
GetComponent
<
Text
>().
text
=
itemList
[
selectedItem
].
itemInfo
;
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
if
(
i
<
itemList
[
selectedItem
].
skillNum
)
{
comboStringFrame
[
i
].
SetActive
(
true
);
comboNameFrame
[
i
].
SetActive
(
true
);
float
tmpx
=
0
;
for
(
int
j
=
0
;
j
<
8
;
j
++)
{
...
...
@@ -115,6 +119,7 @@ public class InventoryUI : MonoBehaviour {
comboChars
[
i
,
j
].
GetComponent
<
RectTransform
>().
sizeDelta
=
comboCharPrefab
[
itemList
[
selectedItem
].
combo
[
i
][
j
]
-
'A'
].
GetComponent
<
RectTransform
>().
sizeDelta
;
comboChars
[
i
,
j
].
GetComponent
<
RectTransform
>().
localPosition
=
new
Vector3
(
tmpx
,
0
,
0
);
tmpx
=
comboChars
[
i
,
j
].
GetComponent
<
RectTransform
>().
sizeDelta
.
x
+
pixelBetweenChar
;
comboNameFrame
[
i
].
GetComponent
<
Text
>().
text
=
itemList
[
selectedItem
].
comboName
[
i
];
}
else
{
...
...
Assets/Scripts/Item/Item.cs
View file @
ba73c3c7
...
...
@@ -14,6 +14,8 @@ public abstract class Item {
public
Sprite
sprite
;
public
Sprite
highlight
;
public
Vector2
sizeInventory
;
public
string
itemInfo
;
public
string
[]
comboName
=
new
string
[
3
];
public
bool
ComboAction
(
string
currentCombo
)
{
...
...
@@ -53,6 +55,9 @@ public abstract class Item {
animation
[
1
]
=
null
;
animation
[
2
]
=
null
;
sizeInventory
=
new
Vector2
(
0
,
0
);
itemInfo
=
null
;
comboName
=
new
string
[
3
]
{
""
,
""
,
""
};
}
protected
virtual
void
PlaySkill1
()
{
...
...
Assets/Scripts/Item/Items/Dagger.cs
View file @
ba73c3c7
...
...
@@ -20,5 +20,7 @@ public class Dagger : Item
animation
[
1
]
=
Resources
.
Load
<
AnimationClip
>(
"Animations/daggerAttack2"
);
animation
[
2
]
=
null
;
sizeInventory
=
new
Vector2
(
127.5f
,
125
);
itemInfo
=
"옛날 옛적 호랑이 담배 피던 시절부터 존재하던 단검이다."
;
comboName
=
new
string
[
3
]
{
"베기"
,
"찌르기"
,
""
};
}
}
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