Base done

This commit is contained in:
Gerard Gascón 2023-08-09 20:07:47 +02:00
parent 32f5ed6299
commit 6ba30e430e
16 changed files with 828 additions and 42 deletions

View file

@ -0,0 +1,20 @@
using System;
using UnityEngine;
public class EnemyWeakPoint1 : MonoBehaviour {
Enemy1 _enemy;
void Awake() {
_enemy = GetComponentInParent<Enemy1>();
}
void OnTriggerEnter2D(Collider2D other) {
if (!other.CompareTag("Player")) return;
PlayerMovement1 player = other.GetComponent<PlayerMovement1>();
player.Rb.velocity = new Vector2(player.Rb.velocity.x, player.deathForce);
player.Animator.SetTrigger(PlayerMovement1.Jump1);
Destroy(_enemy.gameObject);
}
}