I have tried to use to arrays as follows but I have an error message error CS0136: A local variable named i' cannot be declared in this scope because it would give a different meaning to
i’, which is already used in a `parent’ scope to denote something else. Does anyone know what is going wrong?
if (turretBaseID==true)
{
for (int i = 0;i<turretBaseObjects.Length;i++) {
turretBaseObjects[i].active = true;
}
}
if (turretBaseID==false)
{
for (int i = 0;i<turretBaseObjects.Length;i++) {
turretBaseObjects[i].active = false;
}
}
if (trapBaseID==true)
{
for (int i = 0;i<trapBaseObjects.Length;i++) {
trapBaseObjects[i].active = true;
if (trapBaseID==false)
{
for (int i = 0;i<trapBaseObjects.Length;i++) {
trapBaseObjects[i].active = false;
}
}