12 lines
381 B
C#
12 lines
381 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
[RequireComponent (typeof(Collider))]
|
|
public class Hitbox : MonoBehaviour
|
|
{
|
|
public GameObject Owner { get; private set; }
|
|
public event Action<float, Vector3> OnDamage;
|
|
public void Initialize(GameObject Owner) => this.Owner = Owner;
|
|
public void TakeDamage(float damage, Vector3 position) => OnDamage?.Invoke(damage, position);
|
|
}
|