Tag: c#

  • Using a bigger Range of colours from code in Unity

      Create a new C# script in your project called CSSColors.cs and then copy and paste the code below into it. You should then be able to use the colour names specified anywhere in your project. public class CSSColors { // NOTE: The follwing color names come from the CSS3 specification, // Section 4.3 Extended…

  • Working with Negative Numbers in C#

    To convert a negative number to a positive number, use the Abs function. Like this. int myInt = System.Math.Abs(-5); To convert a positive number to a negative number there is no built in function, but you can simply do this, myInt = myInt * -1