Tutorial by Examples

Input must must read from the Update function. Reference for all the available Keycode enum. 1. Reading key press with Input.GetKey: Input.GetKey will repeatedly return true while the user holds down the specified key. This can be used to repeatedly fire a weapon while holding the specified key ...
ANTLR is capable of generating parsers for a number of programming languages: C# Target Python Target JavaScript Target Java Target By default ANTLR will generate a parser from commandline in the Java programming language : Java -jar antlr-4.5.3-complete.jar yourGrammar.g4 //Will output a ...
First it's essential to understand that, game engines (such as Unity) work on a "frame based" paradigm. Code is executed during every frame. That includes Unity's own code, and your code. When thinking about frames, it's important to understand that there is absolutely no guarantee of w...
Often you design coroutines to naturally end when certain goals are met. IEnumerator TickFiveSeconds() { var wait = new WaitForSeconds(1f); int counter = 1; while(counter < 5) { Debug.Log("Tick"); counter++; yield return wait; } ...
import std.stdio; struct A { int b; void c(); string d; }; void main() { // The following foreach is unrolled in compile time foreach(name; __traits(allMembers, A)) { pragma(msg, name); } } The allMembers traits returns a tuple of string containing t...
Swift if let text = self.textView.text where !text.isEmpty { // Do stuff for text } else { // Do stuff for nil text or empty string } Objective-C if (self.textView.text.length > 0){ // Do stuff for text } else { // Do stuff for nil text or empty string }
First we need to set up two basic channels, one for the main queue, and one for the delay queue. In my example at the end, I include a couple of additional flags that are not required, but makes the code more reliable; such as confirm delivery, delivery_mode and durable. You can find more informatio...
Let's say, we have a simple LoginForm class with rules() method (used in login page as framework template): class LoginForm { public $email; public $rememberMe; public $password; /* rules() method returns an array with what each field has as a requirement. * Login form u...
All fragments should have an empty constructor (i.e. a constructor method having no input arguments). Therefore, in order to pass your data to the Fragment being created, you should use the setArguments() method. This methods gets a bundle, which you store your data in, and stores the Bundle in the ...
CSS Getter The .css() getter function can be applied to every DOM element on the page like the following: // Rendered width in px as a string. ex: `150px` // Notice the `as a string` designation - if you require a true integer, // refer to `$.width()` method $("body").css("width...
Dim Value As Byte A Byte is an unsigned 8 bit data type. It can represent integer numbers between 0 and 255 and attempting to store a value outside of that range will result in runtime error 6: Overflow. Byte is the only intrinsic unsigned type available in VBA. The casting function to convert ...
Dim Value As Integer An Integer is a signed 16 bit data type. It can store integer numbers in the range of -32,768 to 32,767 and attempting to store a value outside of that range will result in runtime error 6: Overflow. Integers are stored in memory as little-endian values with negatives repres...
Dim Value As Boolean A Boolean is used to store values that can be represented as either True or False. Internally, the data type is stored as a 16 bit value with 0 representing False and any other value representing True. It should be noted that when a Boolean is cast to a numeric type, all of...
Dim Value As Long A Long is a signed 32 bit data type. It can store integer numbers in the range of -2,147,483,648 to 2,147,483,647 and attempting to store a value outside of that range will result in runtime error 6: Overflow. Longs are stored in memory as little-endian values with negatives re...
Dim Value As Single A Single is a signed 32 bit floating point data type. It is stored internally using a little-endian IEEE 754 memory layout. As such, there is not a fixed range of values that can be represented by the data type - what is limited is the precision of value stored. A Single can...
Dim Value As Double A Double is a signed 64 bit floating point data type. Like the Single, it is stored internally using a little-endian IEEE 754 memory layout and the same precautions regarding precision should be taken. A Double can store integer values in the range of -9,007,199,254,740,992 to...
Dim Value As Currency A Currency is a signed 64 bit floating point data type similar to a Double, but scaled by 10,000 to give greater precision to the 4 digits to the right of the decimal point. A Currency variable can store values from -922,337,203,685,477.5808 to 922,337,203,685,477.5807, givi...
Dim Value As Date A Date type is represented internally as a signed 64 bit floating point data type with the value to the left of the decimal representing the number of days from the epoch date of December 30th, 1899 (although see the note below). The value to the right of the decimal represents ...
A String represents a sequence of characters, and comes in two flavors: Variable length Dim Value As String A variable length String allows appending and truncation and is stored in memory as a COM BSTR. This consists of a 4 byte unsigned integer that stores the length of the String in bytes fo...
Dim Value As LongLong A LongLong is a signed 64 bit data type and is only available in 64 bit applications. It is not available in 32 bit applications running on 64 bit operating systems. It can store integer values in the range of -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 and attem...

Page 453 of 1336