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);
}
}
}