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
e7be3fc3
Commit
e7be3fc3
authored
Feb 01, 2019
by
18류지석
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
공격 정보 클래스화, 적에게 맞으면 피 깎임
parent
e4de4bcb
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
88 additions
and
9 deletions
+88
-9
LifeStoneUI.prefab
Assets/Prefabs/UI/In-Game UI/LifeStoneUI.prefab
+1
-1
PlayScene.unity
Assets/Scenes/PlayScene.unity
+11
-4
AttackProperty.cs
Assets/Scripts/Characters/AttackProperty.cs
+3
-1
Enemy.cs
Assets/Scripts/Characters/Enemy.cs
+2
-2
EnemyAttackInfo.cs
Assets/Scripts/Characters/EnemyAttackInfo.cs
+19
-0
EnemyAttackInfo.cs.meta
Assets/Scripts/Characters/EnemyAttackInfo.cs.meta
+11
-0
PlayerAttack.cs
Assets/Scripts/Characters/PlayerAttack.cs
+6
-0
PlayerAttackInfo.cs
Assets/Scripts/Characters/PlayerAttackInfo.cs
+19
-0
PlayerAttackInfo.cs.meta
Assets/Scripts/Characters/PlayerAttackInfo.cs.meta
+11
-0
DamageToPlayer.cs
Assets/Scripts/DamageToPlayer.cs
+2
-1
Enumerators.cs
Assets/Scripts/Enumerators.cs
+3
-0
No files found.
Assets/Prefabs/UI/In-Game UI/LifeStoneUI.prefab
View file @
e7be3fc3
...
@@ -83,7 +83,7 @@ MonoBehaviour:
...
@@ -83,7 +83,7 @@ MonoBehaviour:
lifeStoneLocation
:
{
x
:
7
,
y
:
7
}
lifeStoneLocation
:
{
x
:
7
,
y
:
7
}
standardImage
:
{
fileID
:
1001509239983906
,
guid
:
a48de94a6ab80f746aec69a02812f1e3
,
standardImage
:
{
fileID
:
1001509239983906
,
guid
:
a48de94a6ab80f746aec69a02812f1e3
,
type
:
2
}
type
:
2
}
lifeStoneRowNum
:
8
lifeStoneRowNum
:
6
lifeStoneSize
:
40
lifeStoneSize
:
40
sprites
:
sprites
:
-
{
fileID
:
21300004
,
guid
:
eff441d843b9c664e97a81fcb39d8410
,
type
:
3
}
-
{
fileID
:
21300004
,
guid
:
eff441d843b9c664e97a81fcb39d8410
,
type
:
3
}
...
...
Assets/Scenes/PlayScene.unity
View file @
e7be3fc3
...
@@ -696,6 +696,12 @@ GameObject:
...
@@ -696,6 +696,12 @@ GameObject:
m_CorrespondingSourceObject
:
{
fileID
:
1939101680453256
,
guid
:
c179f0931cfabec428a868a6edc543b0
,
m_CorrespondingSourceObject
:
{
fileID
:
1939101680453256
,
guid
:
c179f0931cfabec428a868a6edc543b0
,
type
:
2
}
type
:
2
}
m_PrefabInternal
:
{
fileID
:
1711972807
}
m_PrefabInternal
:
{
fileID
:
1711972807
}
---
!u!114
&1206751493
stripped
MonoBehaviour
:
m_CorrespondingSourceObject
:
{
fileID
:
114920782405449110
,
guid
:
c179f0931cfabec428a868a6edc543b0
,
type
:
2
}
m_PrefabInternal
:
{
fileID
:
1711972807
}
m_Script
:
{
fileID
:
11500000
,
guid
:
7fe540ec78947fc449eabc76bd87823d
,
type
:
3
}
---
!u!224
&1209430809
stripped
---
!u!224
&1209430809
stripped
RectTransform
:
RectTransform
:
m_CorrespondingSourceObject
:
{
fileID
:
224402251087470820
,
guid
:
c179f0931cfabec428a868a6edc543b0
,
m_CorrespondingSourceObject
:
{
fileID
:
224402251087470820
,
guid
:
c179f0931cfabec428a868a6edc543b0
,
...
@@ -957,6 +963,11 @@ Prefab:
...
@@ -957,6 +963,11 @@ Prefab:
propertyPath
:
inventoryManager
propertyPath
:
inventoryManager
value
:
value
:
objectReference
:
{
fileID
:
2035175000
}
objectReference
:
{
fileID
:
2035175000
}
-
target
:
{
fileID
:
114880704145925944
,
guid
:
3d077a5f727dd1e4780e9265ed26e036
,
type
:
2
}
propertyPath
:
lifeStoneManager
value
:
objectReference
:
{
fileID
:
1206751493
}
m_RemovedComponents
:
[]
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
3d077a5f727dd1e4780e9265ed26e036
,
type
:
2
}
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
3d077a5f727dd1e4780e9265ed26e036
,
type
:
2
}
m_IsPrefabAsset
:
0
m_IsPrefabAsset
:
0
...
@@ -1141,10 +1152,6 @@ Prefab:
...
@@ -1141,10 +1152,6 @@ Prefab:
propertyPath
:
m_Pivot.y
propertyPath
:
m_Pivot.y
value
:
0
value
:
0
objectReference
:
{
fileID
:
0
}
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
1939101680453256
,
guid
:
c179f0931cfabec428a868a6edc543b0
,
type
:
2
}
propertyPath
:
m_IsActive
value
:
1
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
c179f0931cfabec428a868a6edc543b0
,
type
:
2
}
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
c179f0931cfabec428a868a6edc543b0
,
type
:
2
}
m_IsPrefabAsset
:
0
m_IsPrefabAsset
:
0
...
...
Assets/Scripts/Characters/AttackProperty.cs
View file @
e7be3fc3
...
@@ -13,8 +13,10 @@ public class AttackProperty : MonoBehaviour{
...
@@ -13,8 +13,10 @@ public class AttackProperty : MonoBehaviour{
if
(
collision
.
CompareTag
(
"Enemy"
))
if
(
collision
.
CompareTag
(
"Enemy"
))
{
{
PlayerAttackInfo
curAttack
=
new
PlayerAttackInfo
(
damage
,
knockBackMultiplier
,
debuffNum
,
debuffType
,
debuffTime
);
Enemy
enemyInfo
=
collision
.
transform
.
GetChild
(
0
).
GetComponent
<
Enemy
>();
Debug
.
Log
(
"Ugh!"
);
Debug
.
Log
(
"Ugh!"
);
collision
.
transform
.
GetChild
(
0
).
GetComponent
<
Enemy
>().
GetDamaged
(
damage
);
collision
.
transform
.
GetChild
(
0
).
GetComponent
<
Enemy
>().
GetDamaged
(
curAttack
);
}
}
}
}
}
}
Assets/Scripts/Characters/Enemy.cs
View file @
e7be3fc3
...
@@ -63,8 +63,8 @@ public class Enemy : MonoBehaviour {
...
@@ -63,8 +63,8 @@ public class Enemy : MonoBehaviour {
}
}
// hit by player or debuff
// hit by player or debuff
public
void
GetDamaged
(
float
damage
)
{
public
void
GetDamaged
(
PlayerAttackInfo
attack
)
{
currHealth
-=
damage
;
currHealth
-=
attack
.
damage
;
if
(
currHealth
<=
0
)
{
if
(
currHealth
<=
0
)
{
gameObject
.
SetActive
(
false
);
gameObject
.
SetActive
(
false
);
return
;
return
;
...
...
Assets/Scripts/Characters/EnemyAttackInfo.cs
0 → 100644
View file @
e7be3fc3
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
EnemyAttackInfo
{
public
float
damage
=
0
;
public
float
knockBackMultiplier
=
1f
;
public
int
debuffNum
=
0
;
public
PlayerDebuffCase
[]
debuffType
=
new
PlayerDebuffCase
[
10
];
public
int
[]
debuffTime
=
new
int
[
10
];
public
EnemyAttackInfo
(
float
damage
,
float
knockBackMultiplier
,
int
debuffNum
,
PlayerDebuffCase
[]
debuffType
,
int
[]
debuffTime
)
{
this
.
damage
=
damage
;
this
.
knockBackMultiplier
=
knockBackMultiplier
;
this
.
debuffNum
=
debuffNum
;
this
.
debuffType
=
debuffType
;
this
.
debuffTime
=
debuffTime
;
}
}
Assets/Scripts/Characters/EnemyAttackInfo.cs.meta
0 → 100644
View file @
e7be3fc3
fileFormatVersion: 2
guid: a86d0d10499f2ce44bf3990328cde908
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/Characters/PlayerAttack.cs
View file @
e7be3fc3
...
@@ -17,6 +17,7 @@ public class PlayerAttack : MonoBehaviour {
...
@@ -17,6 +17,7 @@ public class PlayerAttack : MonoBehaviour {
public
AnimatorOverrideController
aoc
;
public
AnimatorOverrideController
aoc
;
public
AnimationClip
[]
normalAttack
=
new
AnimationClip
[
3
];
public
AnimationClip
[]
normalAttack
=
new
AnimationClip
[
3
];
public
InventoryManager
inventoryManager
;
public
InventoryManager
inventoryManager
;
public
LifeStoneManager
lifeStoneManager
;
float
comboEndTime
;
float
comboEndTime
;
bool
comboTimeOn
;
bool
comboTimeOn
;
...
@@ -170,4 +171,9 @@ public class PlayerAttack : MonoBehaviour {
...
@@ -170,4 +171,9 @@ public class PlayerAttack : MonoBehaviour {
return
true
;
return
true
;
return
false
;
return
false
;
}
}
public
void
TakeDamage
(
EnemyAttackInfo
attack
)
{
lifeStoneManager
.
DestroyStone
((
int
)
Mathf
.
Ceil
(
attack
.
damage
));
}
}
}
Assets/Scripts/Characters/PlayerAttackInfo.cs
0 → 100644
View file @
e7be3fc3
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
PlayerAttackInfo
{
public
float
damage
=
0
;
public
float
knockBackMultiplier
=
1f
;
public
int
debuffNum
=
0
;
public
EnemyDebuffCase
[]
debuffType
=
new
EnemyDebuffCase
[
10
];
public
int
[]
debuffTime
=
new
int
[
10
];
public
PlayerAttackInfo
(
float
damage
,
float
knockBackMultiplier
,
int
debuffNum
,
EnemyDebuffCase
[]
debuffType
,
int
[]
debuffTime
)
{
this
.
damage
=
damage
;
this
.
knockBackMultiplier
=
knockBackMultiplier
;
this
.
debuffNum
=
debuffNum
;
this
.
debuffType
=
debuffType
;
this
.
debuffTime
=
debuffTime
;
}
}
Assets/Scripts/Characters/PlayerAttackInfo.cs.meta
0 → 100644
View file @
e7be3fc3
fileFormatVersion: 2
guid: 6147d59b2c75e6142b01390e112e897f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/DamageToPlayer.cs
View file @
e7be3fc3
...
@@ -9,7 +9,8 @@ public class DamageToPlayer : MonoBehaviour {
...
@@ -9,7 +9,8 @@ public class DamageToPlayer : MonoBehaviour {
{
{
if
(
collision
.
CompareTag
(
"Player"
))
if
(
collision
.
CompareTag
(
"Player"
))
{
{
Debug
.
Log
(
"Auch!"
);
EnemyAttackInfo
attack
=
new
EnemyAttackInfo
(
damage
,
1f
,
0
,
null
,
null
);
collision
.
gameObject
.
GetComponent
<
PlayerAttack
>().
TakeDamage
(
attack
);
}
}
}
}
}
}
Assets/Scripts/Enumerators.cs
View file @
e7be3fc3
...
@@ -6,7 +6,10 @@
...
@@ -6,7 +6,10 @@
blind
,
blind
,
charm
charm
};
};
public
enum
PlayerDebuffCase
{
}
public
enum
ItemQuality
public
enum
ItemQuality
{
{
Study
,
Study
,
...
...
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