Question by
foggyqc · Sep 24, 2021 at 06:28 PM ·
weapon system
Trying to add an int in the middle of a line of code and cant find a way to make it work, any suggestions?
public void SetWeaponShowcase(int _class) {
primaryWeaponShowcase.GetComponentInChildren<Image>().sprite = weaponManager.
{_class}.primaryWeapon.icon;
primaryWeaponShowcase.GetComponentInChildren<Text>().text =
weaponManager.{_class}.primaryWeapon.weaponName;
}
Im wanting it so when you call for example SetWeaponShowcase(5), it runs the line primaryWeaponShowcase.GetComponentInChildren().sprite = weaponManager. class5.primaryWeapon.icon;
Comment
Your answer
Follow this Question
Related Questions
Weapon Select Menu 0 Answers
Weapon switching 0 Answers
More bullets spawning that allowed 0 Answers
My attempt to connect left hand to rifle is flipping out (Mecanim/IK) 0 Answers
Prefab destroyed upon instantiation 0 Answers