compare int from 2 Lists<> from different scripts, each attached to different objects

I have to compare the int of 2 Lists .List1 will be set in the Inspector and will differ for every object… and List2 , when I click on an object I will Add. that ID number to the List2.

stuff I don’t know to do : :))
Condition: when all the numbers from List1 , will be included among the numbers from List2 return true, otherwise return false. (eg. List1(1, 2 ,6) and List2 (1,2,3,4,6) this will return true)

Also, List1 script, will be attached to prefabs, that i will instantiate(a lot of them) and List2 script can be on the MainCamera, and will contain and the code for the condition.

any help will be appreciated

Here are the scripts:

List1 script:

using UnityEngine;
using System.Collections.Generic;
using System.Collections;

public class correct : MonoBehaviour

{

public List<int> correctPath = new List<int>();    //will  set in the Inspector individualy for every object

}

List2 Script :

using UnityEngine;
using System.Collections.Generic;
using System.Collections;

public class manager: MonoBehaviour {

public List<int> currentPath = new List<int>();   // current path

void OnMouseOver()
{
    if (Input.GetMouseButtonDown(0))
    {
      currentPath.Add(GetComponent<ID>().theID);
    }

}

}

Hello @VaderCmp, i am not sure if i understood you.

foreach(int i in correctPath)
{
	if(!currentPath.Contains(i))
	return false;
}
return true;

This will check if List2 (currentPath) contains ALL elements of List1 (correctPath). If it find elements that is not included in List2 it will return false, otherwise all iterations will end and function will return true.

Now if you want to get all elements with List1 script use:

List<correct> correct_list = GameObject.FindGameObjectsWithTag("MyTag").GetComponent<correct>();

Remember to give your object a tag to find them easily (i used “MyTag” as example only)