Stash work

This commit is contained in:
Michal Pikulski
2025-12-02 23:56:13 +01:00
parent 2589e56bda
commit bad16d5853
100 changed files with 10105 additions and 124 deletions

View File

@@ -0,0 +1,52 @@
using System.Collections;
using Core;
using UnityEngine;
namespace Minigames.FortFight.Projectiles
{
/// <summary>
/// Ceiling Fan projectile - drops straight down when ability is activated.
/// Player taps screen mid-flight to activate drop.
/// </summary>
public class CeilingFanProjectile : ProjectileBase
{
[Header("Ceiling Fan Specific")]
[Tooltip("Speed of downward drop")]
[SerializeField] private float dropSpeed = 20f;
[Tooltip("Delay before dropping")]
[SerializeField] private float dropDelay = 0.2f;
public override void ActivateAbility()
{
base.ActivateAbility();
if (AbilityActivated)
{
Logging.Debug("[CeilingFanProjectile] Ability activated - dropping straight down");
StartCoroutine(DropCoroutine());
}
}
private IEnumerator DropCoroutine()
{
// Stop all velocity
if (rb2D != null)
{
rb2D.linearVelocity = Vector2.zero;
rb2D.angularVelocity = 0f;
}
// Wait brief moment
yield return new WaitForSeconds(dropDelay);
// Drop straight down
if (rb2D != null)
{
rb2D.linearVelocity = Vector2.down * dropSpeed;
Logging.Debug($"[CeilingFanProjectile] Dropping with velocity: {rb2D.linearVelocity}");
}
}
}
}