Hi!
I am currently working at a card game and I have a very awkward problem. I am Instantiating multiple GameObjects:
for (int i = 0; i < numEnemy; i++)
{
CurrEnemy *= new Enemy();*
CurrEnemy = Storage.EnemyTypes[Storage.en[x].enemies*];*
CurrEnemy*.copy = (GameObject)Instantiate(enemyEmpty, Spawn.transform);*
CurrEnemy_.copy.transform.GetChild(0).GetComponent().sprite = CurrEnemy*.imagine;_
_CurrEnemy.copy.transform.tag = “” + i;_
_CurrEnemy.refresh();
}
But when I try to change the outline of them in this function:
public static void outline(float d)
{
for(int i = 0; i<numEnemy; i++)
{_
_CurrEnemy.copy.transform.GetChild(0).GetComponent().effectColor = new Color(0.98f, 1f, 0f, d);_
_CurrEnemy.copy.GetComponent().interactable = (d==1 ? true : false);
}
}*
Only one GameObject changes. I’ve also tried using copy.SetActive(false) but there was still only one Object disappearing.
Thanks in advance!_