Simple 2 Array bool Comprasion

Hi All!

I’ve been working on a problem for 3 days. I’ve searched the forums and unity answers but even though it’s a simple question, I couldn’t find any results.


Issue details;

I have a player object that contains some items, and incoming object, which also contains some items. I just want to compare the contained objects are active or not.

Something like: If playerObject[0] is active AND incomingObject[0] is active, if playerObject[1] is NOT active AND incomingObject[1] is NOT active. etc…

So BOTH should be TRUE or BOTH should be FALSE. Except these conditions, it has to return false.


Here is what I wrote and didn’t work; (gameObject[0] instead of gameObject because that’s the closest one to the player)
public void CheckFF()
{
gameObjects = GameObject.FindGameObjectsWithTag(“StartIncoming”);
checker = new bool[core.checkActive.Length];
for (int i = 0; i < core.checkActive.Length; i++)
{
if (core.checkActive == true && gameObjects[0].GetComponent().isActive == true)
{
checker = true;
}
else if (core.checkActive == false && gameObjects[0].GetComponent().isActive == false)
{
checker = false;
}
else
{
}
}
if (isItGoodToGo())
{
print(“GOOD TO GO!”);
}
}
private bool isItGoodToGo()
{
for (int i = 0; i < checker.Length; i++)
{
if (checker == true)
{
return true;
}
}
return false;
}

If anyone looking for the answer, I’ve solved it with:

bool fastForwardable = incomingActive.SequenceEqual(checkActive);