Added basic features

This commit is contained in:
2025-05-08 09:24:43 +09:00
parent 4acffb32e4
commit bee969f7ef
131 changed files with 69136 additions and 109 deletions

26
Assets/Scripts/Player.cs Normal file
View File

@@ -0,0 +1,26 @@
using Assets;
using System;
using UnityEngine;
[RequireComponent(typeof(CharacterController2D))]
public class Player : MonoBehaviour
{
public CharacterController2D controller;
public PlayerInteraction playerInteraction;
public Health health;
public Action OnPlayerDead;
public void Start()
{
health.OnDamageTaken += OnDamageTaken;
}
private void OnDamageTaken(DamageData damageData)
{
if (damageData.newHealth <= 0)
{
OnPlayerDead?.Invoke();
}
}
}