public override void Shoot(Vector2 firePoint, Vector2 fireDirection) { if (currentTimerBetweenShots > MaxTimeBetweenShots) { CurrentMagHold--; // Let UI or others know shot has been fired OnShootAction?.Invoke(); // Create bullet with given arguments OnBulletCreated?.Invoke(new ArgsBullet(false, new Vector2(6), firePoint, fireDirection, BulletTexture, BulletDecayTime, BulletMoveSpeed, BulletColliderSize, 50)); // Reset timer currentTimerBetweenShots = 0.0f; } }
public void OnPointerClick(PointerEventData eventData) { OnShootAction?.Invoke(); }