Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Edit variables in script

$
0
0
Hey all! For my game I have many characters with different stats such as damage, speed etc... and I wanted a way to make the stats easier to access. So I created an inspector GUI which displayed the relevant data in a textbox. One of my stat variables is: **static var entity_Damage : int[] = [3, 5, 6, 4];** However my question is can I edit those end variables in the script and have it paste the edited copy to the script? So if in the textbox I changed entity_Damage[0] to 5 the script would become **static var entity_Damage : int[] = [5, 5, 6, 4];** I want this so that I have a hard copy of the variables so if something ever goes wrong i won't lose all the changed values. (also the variable only has 4 to shorten it down but it will eventually have hundreds) I know this is a little hard to explain but thank you for taking the time to read this! Thank You!

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>