Exemple:
var id : int = 12345;
function update(){
if(id|1){
}
if(id|2){
}
....
}
Exemple:
var id : int = 12345;
function update(){
if(id|1){
}
if(id|2){
}
....
}
what do you mean by fractionate?
And your code does little to nothing to exemplify what you want…
Are you attempting to split the number 12345 up? Well the number 12345 is not actually the number of that, it’s the decimal representation of it in word form. To represent words in word form we use strings. So convert to string, loop over the chars.
With your ifs I’m suspecting you wanna see if the number contains some value in it.
if(id.toString().Contains("1")) ...
I want to make when selecting the items, adding the ids go, then I can extract the id of each item in the if.
Exemple:
Shord Id 1;
Shield id 2;
id = 12;
if(id1){
Debug.log(“Shord”);
}
…
lordofduct is right…
if(id.toString().Contains("1")) Debug.Log("Shord");
toString makes it into a String, which is a collection of characters. You then search through that string to find an element.
erro:
MissingMethodException: Method not found: ‘System.String.toString’.
srsly bro,
id.ToString()
sorry, I didn’t capitalize my ‘t’.
If that hangs you up though… you got a big cliff ahead of you.