Quantcast
Channel: Latest Questions by Griffo
Viewing all articles
Browse latest Browse all 94

.js to C# conversion

$
0
0
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)))); } // -----------------------------------------------------------------

Viewing all articles
Browse latest Browse all 94

Trending Articles



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