8 directional magic spell wheel

So i’m making a system where you flick the right stick to cast a spell. all 8 directions can be assigned a spell, and flicking in that direction casts a spell. when you hold the stick, the spell wheel will pop up and slow down time letting you pick any of the 8 spells and on right stick release, it will cast the spell you chose. Now my problem is how to implement this. I have an enum state machine for every spell in the game, my main character can learn all the spells, and I have other playable characters that only learn a particular element. I already have states for the right stick, and Debug.Log confirms that releasing the stick in the desired direction is working. I have an enum state machine for my character states, and when the stick is on the HELD state (I have idle, down, held, and up as stick states) the character becomes the magic casting state. Once stick is released, I have booleans for the 8 directions (castUp, castUpRight, etc). Now, my problem is, how do I easily execute this? I want to assign 8 magic slots for each character, have the game know which slot it is, and know what spell is assigned to that slot, and do that spell when I release the stick in that direction. I’m trying to think of the easiest way to implement this. Maybe I’m thinking too hard, certain spells have the character change state, and certain spells just have the player in the generic cast state and creates an object. Regardless I need help wrapping my head around the script knowing what character I’m playing as (I have an enum for the list of characters as well), which 8 spells are assigned to that character, which direction is what spell, and how to easily cast that spell depending on which direction I release. Sorry if that’s too much, I just want to understand conceptually how to do it, not necessarily with hard code, but if you can provide some code that would help, that would be great thanks.

Have an array/list with your equipped spells.
Convert your input direction to the angle of a circle.
Use this equation to convert it to an index into your array/list to read the spell data:

int index = Mathf.FloorToInt((input angle / 360f) * 8f);

You may need to offset the angle(s) depending on how your radial menu is setup.

Reading the data can be as simple as:

currentCharacter.equippedSpells[index].whatever; // should do a null check before accessing data

and then if they need to have some wind-up animation or something first, that’s more of a character state / FSM issue at that point.