Some things
This commit is contained in:
parent
6ba30e430e
commit
e4cc23e7f0
119 changed files with 70085 additions and 682 deletions
21
Assets/Scripts/Level 4/EnemyWeakPoint4.cs
Normal file
21
Assets/Scripts/Level 4/EnemyWeakPoint4.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace Level4 {
|
||||
public class EnemyWeakPoint4 : MonoBehaviour {
|
||||
|
||||
Enemy4 _enemy;
|
||||
|
||||
void Awake() {
|
||||
_enemy = GetComponentInParent<Enemy4>();
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D other) {
|
||||
if (!other.CompareTag("Player")) return;
|
||||
PlayerMovement4 player = other.GetComponent<PlayerMovement4>();
|
||||
|
||||
player.Rb.velocity = new Vector2(player.Rb.velocity.x, player.deathForce);
|
||||
player.Animator.SetTrigger(PlayerMovement4.Jump1);
|
||||
Destroy(_enemy.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue