hi, i m trying to get the value of a float inside all the Gameobject in my List . i get a new item list everytime the player get inside some trigger. How i can get the value inside this gameobject ?
normally, this variable is inside his script " nucleo ".
float totalElec;
public void Recoleccion( GameObject ho)
{
listadeNucleos.Add(ho);
foreach(GameObject x in listadeNucleos)
{
totalElec += x.GetComponent<nucleo>().elec;
}
}
thanks