Base mechanics done
This commit is contained in:
parent
e4cc23e7f0
commit
eaa8cdd462
67 changed files with 21667 additions and 330 deletions
21
Assets/Scripts/Level 9/EnemyWeakPoint9.cs
Normal file
21
Assets/Scripts/Level 9/EnemyWeakPoint9.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace Level9 {
|
||||
public class EnemyWeakPoint9 : MonoBehaviour {
|
||||
|
||||
Enemy9 _enemy;
|
||||
|
||||
void Awake() {
|
||||
_enemy = GetComponentInParent<Enemy9>();
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D other) {
|
||||
if (!other.CompareTag("Player")) return;
|
||||
PlayerMovement9 player = other.GetComponent<PlayerMovement9>();
|
||||
|
||||
player.Rb.velocity = new Vector2(player.Rb.velocity.x, player.deathForce);
|
||||
player.Animator.SetTrigger(PlayerMovement9.Jump1);
|
||||
Destroy(_enemy.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue