Can i store enum items in an array in a different script

Quick Question hoping someone could help with. I have multiple scripts that have a direction enum { north,south,east,west} where you set the “initial direction” that the gameobject is facing. Is there anyway I can have a seperate script iterate through that list of scripts and store “initial direction in an array” I’m having trouble initializing the array that stores the “initial direction” this is psuedo code from the multiple scripts containing the direction enum

public enum Direction
{
     north, south, east, west
}


public Direction MyDirection;'

Im thinking the code would have to look something like this to access it

    private (?dont know what it would be?)[] _initialDirections;

_initialDirections = new (??)[GameObjectsArray.Length];
    for(int i=0; i < GameObjectsArray.Length; i++)
    {
    _initalDirections _= GameObjectsArray*.GetComponent<Script>().MyDirection;*_

}

enums can be cast as ints; so a solution would be as follows (code not tested!):

private int[] _initialDirections = new int[GameObjectsArray.Length];

for(int i=0; i < GameObjectsArray.Length; i++)
{
    _initalDirections _= (int)GameObjectsArray*.GetComponent<Script>().MyDirection;*_

}
then it’s a simple case of casting the ints back to Directions to retrieve the enum value.