fixed enemy death overtime
This commit is contained in:
parent
dea031f804
commit
a6591839dd
@ -418,6 +418,7 @@ MonoBehaviour:
|
|||||||
landingPoint: {fileID: 0}
|
landingPoint: {fileID: 0}
|
||||||
body: {fileID: 4916962407531476031}
|
body: {fileID: 4916962407531476031}
|
||||||
flyingSpeed: 50
|
flyingSpeed: 50
|
||||||
|
collider: {fileID: 774736357024529276}
|
||||||
--- !u!54 &3119225800646921348
|
--- !u!54 &3119225800646921348
|
||||||
Rigidbody:
|
Rigidbody:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@ -299,6 +299,7 @@ MonoBehaviour:
|
|||||||
landingPoint: {fileID: 0}
|
landingPoint: {fileID: 0}
|
||||||
body: {fileID: 6601239271941144557}
|
body: {fileID: 6601239271941144557}
|
||||||
flyingSpeed: 50
|
flyingSpeed: 50
|
||||||
|
collider: {fileID: 1871861664620959488}
|
||||||
--- !u!135 &1871861664620959488
|
--- !u!135 &1871861664620959488
|
||||||
SphereCollider:
|
SphereCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@ -9,6 +9,7 @@ public class Enemy : MonoBehaviour
|
|||||||
public Transform landingPoint;
|
public Transform landingPoint;
|
||||||
public GameObject body;
|
public GameObject body;
|
||||||
public float flyingSpeed;
|
public float flyingSpeed;
|
||||||
|
public SphereCollider collider;
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
@ -46,7 +47,9 @@ public class Enemy : MonoBehaviour
|
|||||||
body.SetActive(false);
|
body.SetActive(false);
|
||||||
explosion.Emit(100);
|
explosion.Emit(100);
|
||||||
explosionDebris.Emit(40);
|
explosionDebris.Emit(40);
|
||||||
yield return new WaitForSeconds(3f);
|
yield return new WaitForSeconds(.1f);
|
||||||
|
collider.enabled = false;
|
||||||
|
yield return new WaitForSeconds(2f);
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user