Ejemplo n.º 1
0
        public override void OnAttack()
        {
            _muzzleFlesh.transform.localScale = Vector3.one * 0.5f;

            _timer = _time;
            _muzzleFlesh.NextFrame();

            RaycastHit2D hit =
                Physics2D.Raycast(gameObject.transform.position + transform.right * 2, transform.right, 100);

            if (hit.transform != null)
            {
                if (hit.collider.CompareTag("Enemy"))
                {
                    GameplayEvents.EnemyKilled(hit.transform.position);
                    Destroy(hit.transform.gameObject);
                }
            }
        }