Hi,
I'm using the below function to get the number from the game objects name or tag in .js
What I need to do is add the same function to a C# script but I really don't know how to write this in C#
Can someone help me out please .. Cheers.
// -----------------------------------------------------------------
// Function to extract the number from the GameObjectX.tag or .name
// -----------------------------------------------------------------
function ConvertToInt(stringContainingNumber : String) : int{
return System.Convert.ToInt32(stringContainingNumber.Substring(stringContainingNumber.ToList().FindIndex(function(c) char.IsDigit(c))));
}
// -----------------------------------------------------------------
↧