コード例 #1
0
ファイル: UnitWeapon.cs プロジェクト: AciesNN/kotan
        private void HitDetection()
        {
            HitDetected = true;
            OnHitDetected?.Invoke();

            HitEffect();
        }
コード例 #2
0
ファイル: TapRaycaster.cs プロジェクト: Powertr1p/BP_Relax
        private void TryDetectHit(Vector3 position)
        {
            var hit = Physics2D.RaycastAll(position, Vector3.forward, _layerToDetect);

            foreach (var obj in hit)
            {
                if (obj.collider.TryGetComponent(out IPoppable bubble))
                {
                    OnHitDetected?.Invoke(bubble);
                }
            }
        }