I have several weapons in shop scene and I want to shop them in gameplay scene when I buy one. Pleasy, what should I do ?,How can I add a weaponID to my gameplay scene after buying the weapon in shop scene?
for(int i = 0; i < buyButtonList.Count; i++)
{
BuyButton buyButtonScript = buyButtonList*.GetComponent<BuyButton>();*
for(int j = 0; j < weaponList.Count; j++)
{
if(weaponList[j].weaponID == buyButtonScript.weaponID && weaponList[j].bought && weaponList[j].weaponID !=currentWeaponID)
{
buyButtonScript.buttonText.text = “Use”;
}
else if(weaponList[j].weaponID == buyButtonScript.weaponID && weaponList[j].bought && weaponList[j].weaponID == currentWeaponID)
{
buyButtonScript.buttonText.text = “Using”;
}
}
}
}