Commit 24bf0a24 authored by 15김민규's avatar 15김민규

거미넉백 고치고 플랫폼 통과 가능

parent 79f8b032
...@@ -21,7 +21,7 @@ GameObject: ...@@ -21,7 +21,7 @@ GameObject:
- component: {fileID: 4804976410232030} - component: {fileID: 4804976410232030}
- component: {fileID: 50573848117970958} - component: {fileID: 50573848117970958}
- component: {fileID: 61188111102399610} - component: {fileID: 61188111102399610}
m_Layer: 16 m_Layer: 20
m_Name: Spider m_Name: Spider
m_TagString: Enemy m_TagString: Enemy
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
...@@ -37,7 +37,7 @@ GameObject: ...@@ -37,7 +37,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 4205286087293746} - component: {fileID: 4205286087293746}
- component: {fileID: 114337624805266014} - component: {fileID: 114337624805266014}
m_Layer: 0 m_Layer: 20
m_Name: HPBar m_Name: HPBar
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
...@@ -55,7 +55,7 @@ GameObject: ...@@ -55,7 +55,7 @@ GameObject:
- component: {fileID: 212993065858080250} - component: {fileID: 212993065858080250}
- component: {fileID: 95156341909549574} - component: {fileID: 95156341909549574}
- component: {fileID: 114803474034076246} - component: {fileID: 114803474034076246}
m_Layer: 0 m_Layer: 20
m_Name: Body m_Name: Body
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
...@@ -72,7 +72,7 @@ GameObject: ...@@ -72,7 +72,7 @@ GameObject:
- component: {fileID: 4370838883948786} - component: {fileID: 4370838883948786}
- component: {fileID: 61019308264186112} - component: {fileID: 61019308264186112}
- component: {fileID: 114106922099255344} - component: {fileID: 114106922099255344}
m_Layer: 18 m_Layer: 17
m_Name: Hitbox m_Name: Hitbox
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
......
...@@ -379,11 +379,11 @@ Prefab: ...@@ -379,11 +379,11 @@ Prefab:
m_Modifications: m_Modifications:
- target: {fileID: 4804976410232030, guid: e4298313f9e94c44fb057542ec7ad273, type: 2} - target: {fileID: 4804976410232030, guid: e4298313f9e94c44fb057542ec7ad273, type: 2}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 5 value: 11.47
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4804976410232030, guid: e4298313f9e94c44fb057542ec7ad273, type: 2} - target: {fileID: 4804976410232030, guid: e4298313f9e94c44fb057542ec7ad273, type: 2}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y
value: 1 value: -16.37
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4804976410232030, guid: e4298313f9e94c44fb057542ec7ad273, type: 2} - target: {fileID: 4804976410232030, guid: e4298313f9e94c44fb057542ec7ad273, type: 2}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
...@@ -409,6 +409,18 @@ Prefab: ...@@ -409,6 +409,18 @@ Prefab:
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 14 value: 14
objectReference: {fileID: 0} 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_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e4298313f9e94c44fb057542ec7ad273, type: 2} m_SourcePrefab: {fileID: 100100000, guid: e4298313f9e94c44fb057542ec7ad273, type: 2}
m_IsPrefabAsset: 0 m_IsPrefabAsset: 0
...@@ -723,6 +735,11 @@ Prefab: ...@@ -723,6 +735,11 @@ Prefab:
propertyPath: comboUI propertyPath: comboUI
value: value:
objectReference: {fileID: 1504194384} objectReference: {fileID: 1504194384}
- target: {fileID: 114402380471012178, guid: 3d077a5f727dd1e4780e9265ed26e036,
type: 2}
propertyPath: enemyLayer.m_Bits
value: 1114112
objectReference: {fileID: 0}
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
...@@ -1643,6 +1660,52 @@ Prefab: ...@@ -1643,6 +1660,52 @@ Prefab:
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
--- !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 --- !u!1001 &1864071038
Prefab: Prefab:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -775,11 +775,6 @@ Prefab: ...@@ -775,11 +775,6 @@ Prefab:
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 17 value: 17
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 50573848117970958, guid: e4298313f9e94c44fb057542ec7ad273,
type: 2}
propertyPath: m_AngularDrag
value: 50
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e4298313f9e94c44fb057542ec7ad273, type: 2} m_SourcePrefab: {fileID: 100100000, guid: e4298313f9e94c44fb057542ec7ad273, type: 2}
m_IsPrefabAsset: 0 m_IsPrefabAsset: 0
......
...@@ -46,7 +46,6 @@ public class AttackProperty : MonoBehaviour { ...@@ -46,7 +46,6 @@ public class AttackProperty : MonoBehaviour {
private void OnTriggerEnter2D(Collider2D collision) private void OnTriggerEnter2D(Collider2D collision)
{ {
Bounds tmpBounds = new Bounds(); Bounds tmpBounds = new Bounds();
if ((enemyLayer == (enemyLayer | 1 << collision.gameObject.layer)) && !collision.transform.GetChild(0).GetComponent<Enemy>().Invisible) if ((enemyLayer == (enemyLayer | 1 << collision.gameObject.layer)) && !collision.transform.GetChild(0).GetComponent<Enemy>().Invisible)
{ {
......
...@@ -17,20 +17,11 @@ public class DamageToPlayer : MonoBehaviour { ...@@ -17,20 +17,11 @@ public class DamageToPlayer : MonoBehaviour {
private void OnTriggerStay2D(Collider2D collision) 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); EnemyAttackInfo attack = new EnemyAttackInfo(damage, 1f, 0, null, null);
collision.gameObject.GetComponent<PlayerAttack>().TakeDamage(attack); collision.gameObject.GetComponent<PlayerAttack>().TakeDamage(attack);
transform.parent.gameObject.GetComponent<EnemyAir>().bumped = true; 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;
} }
} }
} }
...@@ -46,10 +46,6 @@ public class Enemy : MonoBehaviour { ...@@ -46,10 +46,6 @@ public class Enemy : MonoBehaviour {
// drop item // drop item
private int[] dropTable; private int[] dropTable;
// for bumping attack
public bool bumped = false;
public bool bumpable = true;
// method // method
// Standard method // Standard method
protected virtual void Awake() protected virtual void Awake()
......
...@@ -3,26 +3,24 @@ using System.Collections.Generic; ...@@ -3,26 +3,24 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class EnemyAir : Enemy { public class EnemyAir : Enemy {
// for bumping attack
public bool bumped = false;
public bool prevBumped = false;
protected override void Start() protected override void Start()
{ {
base.Start(); base.Start();
StartCoroutine(BumpCheck()); prevBumped = bumped;
} }
protected override void FixedUpdate() protected override void FixedUpdate()
{ {
base.FixedUpdate(); base.FixedUpdate();
if(prevBumped != bumped && bumped && !MovementLock)
if (bumpable)
{
MovementLock = false;
}
else
{ {
ChangeVelocityXY_zero(); StartCoroutine(Knockback(0.0f, 1.0f));
MovementLock = true; StartCoroutine(RecoverBump());
} }
prevBumped = bumped;
} }
public void ChangeAngleZ_noOption(float val) public void ChangeAngleZ_noOption(float val)
...@@ -87,19 +85,15 @@ public class EnemyAir : Enemy { ...@@ -87,19 +85,15 @@ public class EnemyAir : Enemy {
Vector2 knockbackVelocity = (knockbackDist / knockbackTime) * knockbackDir; Vector2 knockbackVelocity = (knockbackDist / knockbackTime) * knockbackDir;
ChangeAngleZ(Mathf.Atan2(knockbackDir.y, knockbackDir.x) * -1, new bool[] { MovementLock, KnockbackLock }); ChangeAngleZ(Mathf.Atan2(knockbackDir.y, knockbackDir.x) * -1, new bool[] { MovementLock, KnockbackLock });
ChangeVelocityXY(knockbackVelocity, lockArray); ChangeVelocityXY(knockbackVelocity, lockArray);
yield return new WaitForSeconds(knockbackTime); yield return new WaitForSeconds(knockbackTime);
MovementLock = false; MovementLock = false;
ChangeVelocityXY(Vector2.zero, new bool[] { MovementLock, KnockbackLock }); ChangeVelocityXY(Vector2.zero, new bool[] { MovementLock, KnockbackLock });
} }
IEnumerator BumpCheck() IEnumerator RecoverBump()
{ {
while (true) yield return new WaitForSeconds(1.0f);
{ bumped = false;
if (!bumpable) { bumpable = true; }
yield return new WaitForSeconds(1.0f);
}
} }
} }
...@@ -67,24 +67,6 @@ public class EnemyManager : Singleton<EnemyManager> ...@@ -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() public bool IsClear()
{ {
return (EnemyDeadCount == EnemySpawnCount); return (EnemyDeadCount == EnemySpawnCount);
......
...@@ -57,7 +57,7 @@ public class Test : MonoBehaviour { ...@@ -57,7 +57,7 @@ public class Test : MonoBehaviour {
} }
public void SummonEnemy() public void SummonEnemy()
{ {
EnemyManager.Instance.SpawnEnemyToMap_forTest(); EnemyManager.Instance.SpawnEnemyToMap();
} }
......
...@@ -52,4 +52,4 @@ Physics2DSettings: ...@@ -52,4 +52,4 @@ Physics2DSettings:
m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 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_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
m_LayerCollisionMatrix: fedffefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9ff6ffffdffffffffffffffedff6ffffffffffffffffffffdff6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff m_LayerCollisionMatrix: fedfeeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffe9fe6ffffdffffffffffffffedfe6ffffffffffffffffffffdfe6fffed7f6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
...@@ -32,7 +32,7 @@ TagManager: ...@@ -32,7 +32,7 @@ TagManager:
- EnemyTrigger - EnemyTrigger
- EnemyAttack - EnemyAttack
- Player - Player
- - EnemyColliderAir
- -
- -
- -
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment