This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Windows.Forms; | |
// Requires System.Windows.Forms added to a Plugins folder ( C:\Program Files\Unity\Editor\Data\MonoBleedingEdge\lib\mono\2.0) | |
// Requires .NET 2.0 (setting Player Setting -> Configuration -> Api Compatibility Level set to .NET 2.0) | |
// Warning! May throw windows errors in editor but works fine in builds | |
// Example Usage: | |
// WindowsNativeDialog.SimpleMessage("Hello World!"); | |
// WindowsNativeDialog.Message("Hello World!", "Title"); | |
// WindowsNativeDialog.WarningMessage("Hello World!", "Title"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
// Unity MonoBehaviour Example | |
// MonoBehaviour is the base class from which every Unity script derives. | |
public class ExampleScript : MonoBehaviour | |
{ | |
// Awake is called when the script instance is being loaded. | |
void Awake(){} | |
// Start is called on the frame when a script is enabled just before any of the Update methods is called the first time. | |
void Start(){} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Unity Singleton Example | |
// Call with "ClassName.instance.Example();" | |
public static ClassName instance = null; //Static instance of singleton which allows it to be accessed by any other script. | |
//Awake is always called before any Start functions | |
void Awake() | |
{ | |
//Check if instance already exists | |
if (instance == null) | |
//if not, set instance to this |
NewerOlder