using System; using Core; using Sirenix.OdinInspector; using UnityEngine; namespace Components { [Serializable] public class ForceData { public float force = 10f; public Vector3 direction = Vector3.up; public ForceMode forceMode = ForceMode.VelocityChange; } [RequireComponent(typeof(Collider))] public class ForceObject : BaseMonoBehaviour { public static event Action OnPlayerHit; [FoldoutGroup("Force Data", expanded: true)] [HideLabel] [SerializeField] private ForceData force; protected override void ReleaseReferences() {} private void OnTriggerEnter(Collider col) { if (!col.CompareTag("Player")) return; OnPlayerHit?.Invoke(force); } } }