A script with multiple strings
Multiple buttons I can press to change the strings in the first script. Using a single void/ function for every button.
Thats it. How do I do it? I searched for so long, and I can’t find it! Its not just regularly accessing another script, because I have multiple variables I want to change with just the one function I can reuse for the button.
For one thing a void isn’t the equivalent of a JS function, it’s the return type. Also didn’t I already tell you how to cheat this with Split ?
public void BeenClicked(string MyString)
{
string[] stringArray = MyString.Split(':');
You just need to send a string then split out the elements with a delimiter (in this example I used a colon), as long as you know what order the string comes in you can set multiple values and convert back from string to other values e.g.
myInt = int.parse(string[2]);
Assumes you have an int in the third part of the array.