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
24bf0a24
Commit
24bf0a24
authored
Feb 26, 2019
by
15김민규
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
거미넉백 고치고 플랫폼 통과 가능
parent
79f8b032
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
85 additions
and
65 deletions
+85
-65
Spider.prefab
Assets/Prefabs/Characters/Enemy/Spider.prefab
+4
-4
PlayScene.unity
Assets/Scenes/PlayScene.unity
+65
-2
testEnemy.unity
Assets/Scenes/testEnemy.unity
+0
-5
AttackProperty.cs
Assets/Scripts/Characters/AttackProperty.cs
+0
-1
DamageToPlayer.cs
Assets/Scripts/Characters/Enemy/DamageToPlayer.cs
+1
-10
Enemy.cs
Assets/Scripts/Characters/Enemy/Enemy.cs
+0
-4
EnemyAir.cs
Assets/Scripts/Characters/Enemy/EnemyAir.cs
+12
-18
EnemyManager.cs
Assets/Scripts/EnemyManager.cs
+0
-18
Test.cs
Assets/Scripts/TetrisMap/Test.cs
+1
-1
Physics2DSettings.asset
ProjectSettings/Physics2DSettings.asset
+1
-1
TagManager.asset
ProjectSettings/TagManager.asset
+1
-1
No files found.
Assets/Prefabs/Characters/Enemy/Spider.prefab
View file @
24bf0a24
...
...
@@ -21,7 +21,7 @@ GameObject:
-
component
:
{
fileID
:
4804976410232030
}
-
component
:
{
fileID
:
50573848117970958
}
-
component
:
{
fileID
:
61188111102399610
}
m_Layer
:
16
m_Layer
:
20
m_Name
:
Spider
m_TagString
:
Enemy
m_Icon
:
{
fileID
:
0
}
...
...
@@ -37,7 +37,7 @@ GameObject:
m_Component
:
-
component
:
{
fileID
:
4205286087293746
}
-
component
:
{
fileID
:
114337624805266014
}
m_Layer
:
0
m_Layer
:
2
0
m_Name
:
HPBar
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
...
...
@@ -55,7 +55,7 @@ GameObject:
-
component
:
{
fileID
:
212993065858080250
}
-
component
:
{
fileID
:
95156341909549574
}
-
component
:
{
fileID
:
114803474034076246
}
m_Layer
:
0
m_Layer
:
2
0
m_Name
:
Body
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
...
...
@@ -72,7 +72,7 @@ GameObject:
-
component
:
{
fileID
:
4370838883948786
}
-
component
:
{
fileID
:
61019308264186112
}
-
component
:
{
fileID
:
114106922099255344
}
m_Layer
:
1
8
m_Layer
:
1
7
m_Name
:
Hitbox
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
...
...
Assets/Scenes/PlayScene.unity
View file @
24bf0a24
...
...
@@ -379,11 +379,11 @@ Prefab:
m_Modifications
:
-
target
:
{
fileID
:
4804976410232030
,
guid
:
e4298313f9e94c44fb057542ec7ad273
,
type
:
2
}
propertyPath
:
m_LocalPosition.x
value
:
5
value
:
11.47
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4804976410232030
,
guid
:
e4298313f9e94c44fb057542ec7ad273
,
type
:
2
}
propertyPath
:
m_LocalPosition.y
value
:
1
value
:
-16.37
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4804976410232030
,
guid
:
e4298313f9e94c44fb057542ec7ad273
,
type
:
2
}
propertyPath
:
m_LocalPosition.z
...
...
@@ -409,6 +409,18 @@ Prefab:
propertyPath
:
m_RootOrder
value
:
14
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
1346522711063220
,
guid
:
e4298313f9e94c44fb057542ec7ad273
,
type
:
2
}
propertyPath
:
m_Layer
value
:
16
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
1860030746010208
,
guid
:
e4298313f9e94c44fb057542ec7ad273
,
type
:
2
}
propertyPath
:
m_Layer
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
1822069857481414
,
guid
:
e4298313f9e94c44fb057542ec7ad273
,
type
:
2
}
propertyPath
:
m_Layer
value
:
0
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
e4298313f9e94c44fb057542ec7ad273
,
type
:
2
}
m_IsPrefabAsset
:
0
...
...
@@ -723,6 +735,11 @@ Prefab:
propertyPath
:
comboUI
value
:
objectReference
:
{
fileID
:
1504194384
}
-
target
:
{
fileID
:
114402380471012178
,
guid
:
3d077a5f727dd1e4780e9265ed26e036
,
type
:
2
}
propertyPath
:
enemyLayer.m_Bits
value
:
1114112
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
3d077a5f727dd1e4780e9265ed26e036
,
type
:
2
}
m_IsPrefabAsset
:
0
...
...
@@ -1643,6 +1660,52 @@ Prefab:
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
c179f0931cfabec428a868a6edc543b0
,
type
:
2
}
m_IsPrefabAsset
:
0
---
!u!1001
&1745261819
Prefab
:
m_ObjectHideFlags
:
0
serializedVersion
:
2
m_Modification
:
m_TransformParent
:
{
fileID
:
0
}
m_Modifications
:
-
target
:
{
fileID
:
4985224690782364
,
guid
:
00231b2b95c4e464083ff598536b1e00
,
type
:
2
}
propertyPath
:
m_LocalPosition.x
value
:
3.115
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4985224690782364
,
guid
:
00231b2b95c4e464083ff598536b1e00
,
type
:
2
}
propertyPath
:
m_LocalPosition.y
value
:
1.126
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4985224690782364
,
guid
:
00231b2b95c4e464083ff598536b1e00
,
type
:
2
}
propertyPath
:
m_LocalPosition.z
value
:
-0.107421875
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4985224690782364
,
guid
:
00231b2b95c4e464083ff598536b1e00
,
type
:
2
}
propertyPath
:
m_LocalRotation.x
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4985224690782364
,
guid
:
00231b2b95c4e464083ff598536b1e00
,
type
:
2
}
propertyPath
:
m_LocalRotation.y
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4985224690782364
,
guid
:
00231b2b95c4e464083ff598536b1e00
,
type
:
2
}
propertyPath
:
m_LocalRotation.z
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4985224690782364
,
guid
:
00231b2b95c4e464083ff598536b1e00
,
type
:
2
}
propertyPath
:
m_LocalRotation.w
value
:
1
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4985224690782364
,
guid
:
00231b2b95c4e464083ff598536b1e00
,
type
:
2
}
propertyPath
:
m_RootOrder
value
:
15
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
1038441420714538
,
guid
:
00231b2b95c4e464083ff598536b1e00
,
type
:
2
}
propertyPath
:
m_IsActive
value
:
0
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
00231b2b95c4e464083ff598536b1e00
,
type
:
2
}
m_IsPrefabAsset
:
0
---
!u!1001
&1864071038
Prefab
:
m_ObjectHideFlags
:
0
...
...
Assets/Scenes/testEnemy.unity
View file @
24bf0a24
...
...
@@ -775,11 +775,6 @@ Prefab:
propertyPath
:
m_RootOrder
value
:
17
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
50573848117970958
,
guid
:
e4298313f9e94c44fb057542ec7ad273
,
type
:
2
}
propertyPath
:
m_AngularDrag
value
:
50
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
e4298313f9e94c44fb057542ec7ad273
,
type
:
2
}
m_IsPrefabAsset
:
0
...
...
Assets/Scripts/Characters/AttackProperty.cs
View file @
24bf0a24
...
...
@@ -46,7 +46,6 @@ public class AttackProperty : MonoBehaviour {
private
void
OnTriggerEnter2D
(
Collider2D
collision
)
{
Bounds
tmpBounds
=
new
Bounds
();
if
((
enemyLayer
==
(
enemyLayer
|
1
<<
collision
.
gameObject
.
layer
))
&&
!
collision
.
transform
.
GetChild
(
0
).
GetComponent
<
Enemy
>().
Invisible
)
{
...
...
Assets/Scripts/Characters/Enemy/DamageToPlayer.cs
View file @
24bf0a24
...
...
@@ -17,20 +17,11 @@ public class DamageToPlayer : MonoBehaviour {
private
void
OnTriggerStay2D
(
Collider2D
collision
)
{
if
(
collision
.
CompareTag
(
"Player"
)
&&
isBumpAttack
&&
transform
.
parent
.
gameObject
.
GetComponent
<
Enemy
>().
bumpable
)
if
(
collision
.
CompareTag
(
"Player"
)
&&
isBumpAttack
&&
!
transform
.
parent
.
gameObject
.
GetComponent
<
EnemyAir
>().
bumped
)
{
EnemyAttackInfo
attack
=
new
EnemyAttackInfo
(
damage
,
1f
,
0
,
null
,
null
);
collision
.
gameObject
.
GetComponent
<
PlayerAttack
>().
TakeDamage
(
attack
);
transform
.
parent
.
gameObject
.
GetComponent
<
EnemyAir
>().
bumped
=
true
;
transform
.
parent
.
gameObject
.
GetComponent
<
EnemyAir
>().
bumpable
=
false
;
}
}
private
void
OnTriggerExit2D
(
Collider2D
collision
)
{
if
(
collision
.
CompareTag
(
"Player"
)
&&
isBumpAttack
)
{
transform
.
parent
.
gameObject
.
GetComponent
<
Enemy
>().
bumped
=
false
;
}
}
}
Assets/Scripts/Characters/Enemy/Enemy.cs
View file @
24bf0a24
...
...
@@ -46,10 +46,6 @@ public class Enemy : MonoBehaviour {
// drop item
private
int
[]
dropTable
;
// for bumping attack
public
bool
bumped
=
false
;
public
bool
bumpable
=
true
;
// method
// Standard method
protected
virtual
void
Awake
()
...
...
Assets/Scripts/Characters/Enemy/EnemyAir.cs
View file @
24bf0a24
...
...
@@ -3,26 +3,24 @@ using System.Collections.Generic;
using
UnityEngine
;
public
class
EnemyAir
:
Enemy
{
// for bumping attack
public
bool
bumped
=
false
;
public
bool
prevBumped
=
false
;
protected
override
void
Start
()
{
base
.
Start
();
StartCoroutine
(
BumpCheck
())
;
prevBumped
=
bumped
;
}
protected
override
void
FixedUpdate
()
{
base
.
FixedUpdate
();
if
(
bumpable
)
{
MovementLock
=
false
;
}
else
if
(
prevBumped
!=
bumped
&&
bumped
&&
!
MovementLock
)
{
ChangeVelocityXY_zero
(
);
MovementLock
=
true
;
StartCoroutine
(
Knockback
(
0.0f
,
1.0f
)
);
StartCoroutine
(
RecoverBump
())
;
}
prevBumped
=
bumped
;
}
public
void
ChangeAngleZ_noOption
(
float
val
)
...
...
@@ -87,19 +85,15 @@ public class EnemyAir : Enemy {
Vector2
knockbackVelocity
=
(
knockbackDist
/
knockbackTime
)
*
knockbackDir
;
ChangeAngleZ
(
Mathf
.
Atan2
(
knockbackDir
.
y
,
knockbackDir
.
x
)
*
-
1
,
new
bool
[]
{
MovementLock
,
KnockbackLock
});
ChangeVelocityXY
(
knockbackVelocity
,
lockArray
);
yield
return
new
WaitForSeconds
(
knockbackTime
);
MovementLock
=
false
;
ChangeVelocityXY
(
Vector2
.
zero
,
new
bool
[]
{
MovementLock
,
KnockbackLock
});
}
IEnumerator
BumpCheck
()
IEnumerator
RecoverBump
()
{
while
(
true
)
{
if
(!
bumpable
)
{
bumpable
=
true
;
}
yield
return
new
WaitForSeconds
(
1.0f
);
}
yield
return
new
WaitForSeconds
(
1.0f
);
bumped
=
false
;
}
}
Assets/Scripts/EnemyManager.cs
View file @
24bf0a24
...
...
@@ -67,24 +67,6 @@ public class EnemyManager : Singleton<EnemyManager>
}
}
// Spawn Enemy to Map
public
void
SpawnEnemyToMap_forTest
()
{
EnemySpawnCount
=
EnemyDeadCount
=
0
;
Transform
enemySpots
=
GameObject
.
Find
(
"Grid"
).
transform
.
GetChild
(
0
).
GetChild
(
0
).
Find
(
"enemy spot"
);
foreach
(
Transform
enemySpot
in
enemySpots
)
{
if
(!
enemySpot
.
gameObject
.
activeSelf
)
continue
;
GameObject
enemy
=
enemySpot
.
gameObject
.
GetComponent
<
enemySpot
>().
enemyPrefab
;
foreach
(
Transform
location
in
enemySpot
)
{
GameObject
clone
=
PickFromPool
(
enemy
);
clone
.
transform
.
position
=
location
.
position
;
clone
.
transform
.
SetParent
(
MapManager
.
currentRoom
.
roomInGame
.
transform
);
}
}
}
public
bool
IsClear
()
{
return
(
EnemyDeadCount
==
EnemySpawnCount
);
...
...
Assets/Scripts/TetrisMap/Test.cs
View file @
24bf0a24
...
...
@@ -57,7 +57,7 @@ public class Test : MonoBehaviour {
}
public
void
SummonEnemy
()
{
EnemyManager
.
Instance
.
SpawnEnemyToMap
_forTest
();
EnemyManager
.
Instance
.
SpawnEnemyToMap
();
}
...
...
ProjectSettings/Physics2DSettings.asset
View file @
24bf0a24
...
...
@@ -52,4 +52,4 @@ Physics2DSettings:
m_ColliderAsleepColor
:
{
r
:
0.5686275
,
g
:
0.95686275
,
b
:
0.54509807
,
a
:
0.36078432
}
m_ColliderContactColor
:
{
r
:
1
,
g
:
0
,
b
:
1
,
a
:
0.6862745
}
m_ColliderAABBColor
:
{
r
:
1
,
g
:
1
,
b
:
0
,
a
:
0.2509804
}
m_LayerCollisionMatrix
:
fedf
fefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9ff6ffffdffffffffffffffedff6ffffffffffffffffffffdff6ffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_LayerCollisionMatrix
:
fedf
eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffe9fe6ffffdffffffffffffffedfe6ffffffffffffffffffffdfe6fffed7f6
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ProjectSettings/TagManager.asset
View file @
24bf0a24
...
...
@@ -32,7 +32,7 @@ TagManager:
-
EnemyTrigger
-
EnemyAttack
-
Player
-
-
EnemyColliderAir
-
-
-
...
...
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