Hello!
I’m making a 2d fighter, and my hitboxes are activated/deactivated by the currentSprite.sprite.
currentSprite = GetComponent();
for example:
if (jabSpriteHitFrame == currentSprite.sprite)
{
JabBox.gameObject.SetActive(true);
}
else
JabBox.gameObject.SetActive(false);
this works perfectly for single-frame attacks, but I have a few multi-frame attacks and would like a similar code to access the currentSprite from an array rather than declare a bunch of frames and repeat the above code.
something along these lines:
public Sprite[ ] flashkickActiveFrames;
if (flashkickActiveFrames == currentSprite.sprite)
flashkickBox.gameObject.SetActive(true);
else
flashkickBox.gameObject.SetActive(false);
thank you!