start work on implementing gameplay

This commit is contained in:
Sylvia 2026-06-25 15:15:16 -07:00
parent 94f5a5e209
commit 274af1e5a1
42 changed files with 3054 additions and 371 deletions

View file

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using UnityEngine;
public class YoumuDeflect : Ability
{
private List<Projectile> projectilesInRange = new();
protected override void AbilityEffects()
{
base.AbilityEffects();
foreach (Projectile projectile in projectilesInRange)
{
projectile.transform.eulerAngles = new Vector3(0, 0, 180);
projectile.direction = -transform.right;
projectile.tag = tag;
}
}
private void OnTriggerEnter2D(Collider2D other)
{
if (!other.CompareTag(tag) && other.TryGetComponent(out Projectile isProjectile))
{
projectilesInRange.Add(isProjectile);
}
}
private void OnTriggerExit2D(Collider2D other)
{
if (!other.CompareTag(tag) && other.TryGetComponent(out Projectile isProjectile) && projectilesInRange.Contains(isProjectile))
{
projectilesInRange.Add(isProjectile);
}
}
}