When I do it this way
for(var i : int = 0;i < (possibles.Length);i++)
{
possibleScripts _= possibles*.gameObject.GetComponent("GunScript");*_
possibleScripts_.cashPrice = possiblesCosts*;
(((possibleScripts.shotMaxDamage + possibleScripts.shotMinDamage)/2) * (possibleScripts.ammo ) (2.65 ))+ (PlayerScores.difficulty * 12);
}
isntead of
doScript = currentGun.gameObject.GetComponent(“GunScript”);
doScript.cashPrice = possiblesCosts[gunToPick];
it changes the values of the prefab associated, instead of just the instance. Is this because the guns are added into an array beforeHand, and are thus just referencing the prefabs? If so is there a way I can pre spawn them?
I mean, this works, but it seems “Less correct”._