How to get the Resource from its instantiated scene?

Godot Version

v4.2.1

Question

Hi, I’m a complete new beginner. I’m working on a game where you catch falling food and make dishes.
I created custom resource for each food and also each dish, which include their respective packedscene. The dish resource includes an array variable of the food resources.
I want to compare the array of the instantiated food scenes I current caught with the arrays for dish resources to check if a dish can be made.
But I don’t know how to proceed because they seem to be two completely different things to compare with…
I’m starting to doubt that maybe resource is not the way to go?
Thank you so much for reading through my post!

You can try the following:

var all_food: Array = []
# This is to centralize all caught food in one array
for food_array in caught_food_arrays:
    for food in food_array:
        if not food in all_food:
            all_food.append(food)

var possible_dishes: Array = []
for dish in all_dishes:
    if dish.can_be_prepared(food):
        possible_dishes.append(dish)