<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.unity3d.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.unity3d.com/index.php?title=Special:NewPages&amp;feed=atom&amp;hideliu=&amp;hidepatrolled=&amp;hidebots=&amp;hideredirs=1&amp;limit=50&amp;namespace=0</id>
		<title>Unify Community Wiki - New pages [en]</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.unity3d.com/index.php?title=Special:NewPages&amp;feed=atom&amp;hideliu=&amp;hidepatrolled=&amp;hidebots=&amp;hideredirs=1&amp;limit=50&amp;namespace=0"/>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/Special:NewPages"/>
		<updated>2013-05-19T19:27:27Z</updated>
		<subtitle>From Unify Community Wiki</subtitle>
		<generator>MediaWiki 1.19.1</generator>

	<entry>
		<id>http://wiki.unity3d.com/index.php/OpenInFileBrowser</id>
		<title>OpenInFileBrowser</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/OpenInFileBrowser"/>
				<updated>2013-05-09T05:08:59Z</updated>
		
		<summary type="html">&lt;p&gt;AnomalousUnderdog: Added code to determine OS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Use `OpenInFileBrowser.Open()` for a cross-platform way of opening any file/folder. This gives your code a &amp;quot;Reveal in Finder&amp;quot; or &amp;quot;Open in Explorer&amp;quot; functionality. Can be useful for editor scripts but probably can be used for non-editor scripts for desktop builds also (for in-game mod editors perhaps?).&lt;br /&gt;
&lt;br /&gt;
If you specify a path with a file at the end, the code will open your file browser with that file selected/highlighted. If you specify a folder instead, it will open the contents of that folder with nothing in it selected.&lt;br /&gt;
&lt;br /&gt;
I place this code in the public domain. Feel free to use it!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
public static class OpenInFileBrowser&lt;br /&gt;
{&lt;br /&gt;
	public static bool IsInMacOS&lt;br /&gt;
	{&lt;br /&gt;
		get&lt;br /&gt;
		{&lt;br /&gt;
			return SystemInfo.operatingSystem.IndexOf(&amp;quot;Mac OS&amp;quot;) != -1;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public static bool IsInWinOS&lt;br /&gt;
	{&lt;br /&gt;
		get&lt;br /&gt;
		{&lt;br /&gt;
			return SystemInfo.operatingSystem.IndexOf(&amp;quot;Windows&amp;quot;) != -1;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	[MenuItem(&amp;quot;Window/Test OpenInFileBrowser&amp;quot;)]&lt;br /&gt;
	public static void Test()&lt;br /&gt;
	{&lt;br /&gt;
		//string path = &amp;quot;/Users/Ferds/Unity Projects/BuildReportTool/BuildReportUnityProject/Assets/BuildReportDebug&amp;quot;;&lt;br /&gt;
		//string path = &amp;quot;/Users/Ferds/Unity Projects/BuildReportTool/BuildReportUnityProject/Assets/BuildReportDebug/EditorMorel.log.txt&amp;quot;;&lt;br /&gt;
		//string path = &amp;quot;/Users/Ferds/UnityBuildReports/&amp;quot;;&lt;br /&gt;
		string path = &amp;quot;/Users/Ferds/UnityBuildReports/test4.xml&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
		Open(path);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	public static void OpenInMac(string path)&lt;br /&gt;
	{&lt;br /&gt;
		bool openInsidesOfFolder = false;&lt;br /&gt;
&lt;br /&gt;
		// try mac&lt;br /&gt;
		string macPath = path.Replace(&amp;quot;\\&amp;quot;, &amp;quot;/&amp;quot;); // mac finder doesn't like backward slashes&lt;br /&gt;
&lt;br /&gt;
		if (Directory.Exists(macPath)) // if path requested is a folder, automatically open insides of that folder&lt;br /&gt;
		{&lt;br /&gt;
			openInsidesOfFolder = true;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		//Debug.Log(&amp;quot;macPath: &amp;quot; + macPath);&lt;br /&gt;
		//Debug.Log(&amp;quot;openInsidesOfFolder: &amp;quot; + openInsidesOfFolder);&lt;br /&gt;
&lt;br /&gt;
		if (!macPath.StartsWith(&amp;quot;\&amp;quot;&amp;quot;))&lt;br /&gt;
		{&lt;br /&gt;
			macPath = &amp;quot;\&amp;quot;&amp;quot; + macPath;&lt;br /&gt;
		}&lt;br /&gt;
		if (!macPath.EndsWith(&amp;quot;\&amp;quot;&amp;quot;))&lt;br /&gt;
		{&lt;br /&gt;
			macPath = macPath + &amp;quot;\&amp;quot;&amp;quot;;&lt;br /&gt;
		}&lt;br /&gt;
		string arguments = (openInsidesOfFolder ? &amp;quot;&amp;quot; : &amp;quot;-R &amp;quot;) + macPath;&lt;br /&gt;
		//Debug.Log(&amp;quot;arguments: &amp;quot; + arguments);&lt;br /&gt;
		try&lt;br /&gt;
		{&lt;br /&gt;
			System.Diagnostics.Process.Start(&amp;quot;open&amp;quot;, arguments);&lt;br /&gt;
		}&lt;br /&gt;
		catch(System.ComponentModel.Win32Exception e)&lt;br /&gt;
		{&lt;br /&gt;
			// tried to open mac finder in windows&lt;br /&gt;
			// just silently skip error&lt;br /&gt;
			// we currently have no platform define for the current OS we are in, so we resort to this&lt;br /&gt;
			e.HelpLink = &amp;quot;&amp;quot;; // do anything with this variable to silence warning about not using it&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public static void OpenInWin(string path)&lt;br /&gt;
	{&lt;br /&gt;
		bool openInsidesOfFolder = false;&lt;br /&gt;
&lt;br /&gt;
		// try windows&lt;br /&gt;
		string winPath = path.Replace(&amp;quot;/&amp;quot;, &amp;quot;\\&amp;quot;); // windows explorer doesn't like forward slashes&lt;br /&gt;
&lt;br /&gt;
		if (Directory.Exists(winPath)) // if path requested is a folder, automatically open insides of that folder&lt;br /&gt;
		{&lt;br /&gt;
			openInsidesOfFolder = true;&lt;br /&gt;
		}&lt;br /&gt;
		try&lt;br /&gt;
		{&lt;br /&gt;
			System.Diagnostics.Process.Start(&amp;quot;explorer.exe&amp;quot;, (openInsidesOfFolder ? &amp;quot;/root,&amp;quot; : &amp;quot;/select,&amp;quot;) + winPath);&lt;br /&gt;
		}&lt;br /&gt;
		catch(System.ComponentModel.Win32Exception e)&lt;br /&gt;
		{&lt;br /&gt;
			// tried to open win explorer in mac&lt;br /&gt;
			// just silently skip error&lt;br /&gt;
			// we currently have no platform define for the current OS we are in, so we resort to this&lt;br /&gt;
			e.HelpLink = &amp;quot;&amp;quot;; // do anything with this variable to silence warning about not using it&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public static void Open(string path)&lt;br /&gt;
	{&lt;br /&gt;
		if (IsInWinOS)&lt;br /&gt;
		{&lt;br /&gt;
			OpenInWinFileBrowser(path);&lt;br /&gt;
		}&lt;br /&gt;
		else if (IsInMacOS)&lt;br /&gt;
		{&lt;br /&gt;
			OpenInMacFileBrowser(path);&lt;br /&gt;
		}&lt;br /&gt;
		else // couldn't determine OS&lt;br /&gt;
		{&lt;br /&gt;
			OpenInWinFileBrowser(path);&lt;br /&gt;
			OpenInMacFileBrowser(path);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>AnomalousUnderdog</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/Windows_Saved_Game_Directory</id>
		<title>Windows Saved Game Directory</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/Windows_Saved_Game_Directory"/>
				<updated>2013-04-04T21:16:12Z</updated>
		
		<summary type="html">&lt;p&gt;Markus Ewald: Added small notice recommending Ctrl+F&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you want to store your saved games in the file system instead of using Unity's PlayerPrefs, there are some conventions for where saved games should be stored on the Windows platform, but figuring out where the appropriate directories are is not trivial.&lt;br /&gt;
&lt;br /&gt;
* On Windows XP, saved game files should go in &amp;lt;tt&amp;gt;C:\Users\&amp;lt;em&amp;gt;Name&amp;lt;/em&amp;gt;\My Documents\My Games&amp;lt;/tt&amp;gt; (examples: Borderlands, Skyrim, Torchlight). As far as I know this isn't an official recommendation, but it is established practice.&lt;br /&gt;
* Windows Vista and later provide the special &amp;lt;tt&amp;gt;C:\Users\&amp;lt;em&amp;gt;Name&amp;lt;/em&amp;gt;\Saved Games&amp;lt;/tt&amp;gt; directory. Not many games are using this yet, probably due to tech support worries if the directory changes depending on the OS used.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
The relevant method to call is &amp;lt;code&amp;gt;getSaveGameDirectory()&amp;lt;/code&amp;gt; (Ctrl+F to jump to where it's used).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.ComponentModel;&lt;br /&gt;
using System.IO;&lt;br /&gt;
using System.Runtime.CompilerServices;&lt;br /&gt;
using System.Runtime.InteropServices;&lt;br /&gt;
using System.Text;&lt;br /&gt;
&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
&lt;br /&gt;
/// &amp;lt;summary&amp;gt;Example component that looks up the saved game folder&amp;lt;/summary&amp;gt;&lt;br /&gt;
public class SaveGameLocation : MonoBehaviour {&lt;br /&gt;
&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;Maximum buffer size most Win32 API functions expect&amp;lt;/summary&amp;gt;&lt;br /&gt;
  private const int MAX_PATH = 260;&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;Special folder id of the user's 'My Documents' folder&amp;lt;/summary&amp;gt;&lt;br /&gt;
  private const int CSIDL_PERSONAL = 0x0005;&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;COM ClassID of the KnownFolderManager proxy coclass&amp;lt;/summary&amp;gt;&lt;br /&gt;
  private const string CLSID_KnownFolderManager = &amp;quot;4df0c730-df9d-4ae3-9153-aa6b82e9795a&amp;quot;;&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;COM InterfaceID of the IKnownFolder interface&amp;lt;/summary&amp;gt;&lt;br /&gt;
  private const string IID_IKnownFolder = &amp;quot;3aa7af7e-9b36-420c-a8e3-f77d4674a488&amp;quot;;&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;COM InterfaceID of the IKnownFolderManager interface&amp;lt;/summary&amp;gt;&lt;br /&gt;
  private const string IID_IKnownFolderManager = &amp;quot;8be2d872-86aa-4d47-b776-32cca40c7018&amp;quot;;&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;ID of the 'Saved Games' folder in the known folder manager&amp;lt;/summary&amp;gt;&lt;br /&gt;
  private static readonly Guid FOLDERID_SavedGames = new Guid(&lt;br /&gt;
    0x4c5c32ff, 0xbb9d, 0x43b0, 0xb5, 0xb4, 0x2d, 0x72, 0xe5, 0x4e, 0xaa, 0xa4&lt;br /&gt;
  );&lt;br /&gt;
&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;Retrieves the path of a special folder, identified by its CSIDL&amp;lt;/summary&amp;gt;&lt;br /&gt;
  /// &amp;lt;param name=&amp;quot;ownerWindowHandle&amp;quot;&amp;gt;Not used, always set to IntPtr.Zero&amp;lt;/param&amp;gt;&lt;br /&gt;
  /// &amp;lt;param name=&amp;quot;path&amp;quot;&amp;gt;Received the drive and path o the specified folder&amp;lt;/param&amp;gt;&lt;br /&gt;
  /// &amp;lt;param name=&amp;quot;folderId&amp;quot;&amp;gt;&lt;br /&gt;
  ///   CSIDL that identifies that folder whose path will be retrieved&lt;br /&gt;
  /// &amp;lt;/param&amp;gt;&lt;br /&gt;
  /// &amp;lt;param name=&amp;quot;createFlag&amp;quot;&amp;gt;&lt;br /&gt;
  ///   Whether the folder should be created if it doesn't exist&lt;br /&gt;
  /// &amp;lt;/param&amp;gt;&lt;br /&gt;
  /// &amp;lt;returns&amp;gt;Any nonzero value if successful, otherwise 0&amp;lt;/returns&amp;gt;&lt;br /&gt;
  [DllImport(&amp;quot;Shell32&amp;quot;, CharSet = CharSet.Unicode)]&lt;br /&gt;
  private static extern int SHGetSpecialFolderPath(&lt;br /&gt;
    IntPtr ownerWindowHandle,&lt;br /&gt;
    StringBuilder path,&lt;br /&gt;
    int folderId,&lt;br /&gt;
    int createFlag&lt;br /&gt;
  );&lt;br /&gt;
&lt;br /&gt;
  #region interface IKnownFolder&lt;br /&gt;
&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;Accesses informations about a known folder, including its path&amp;lt;/summary&amp;gt;&lt;br /&gt;
  [&lt;br /&gt;
    ComImport,&lt;br /&gt;
    Guid(IID_IKnownFolder),&lt;br /&gt;
    InterfaceType(ComInterfaceType.InterfaceIsIUnknown)&lt;br /&gt;
  ]&lt;br /&gt;
  private interface IKnownFolder {&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;GetId() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void GetId_Stub();&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;GetCategory() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void GetCategory_Stub();&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;GetShellItem() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void GetShellItem_Stub();&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;Retrieves the path of a known folder as a string&amp;lt;/summary&amp;gt;&lt;br /&gt;
    /// &amp;lt;param name=&amp;quot;flags&amp;quot;&amp;gt;&lt;br /&gt;
    ///   Flags that specify special retrieval options. This value can be 0;&lt;br /&gt;
    ///   otherwise, one or more of the KNOWN_FOLDER_FLAG values&lt;br /&gt;
    /// &amp;lt;/param&amp;gt;&lt;br /&gt;
    /// &amp;lt;param name=&amp;quot;path&amp;quot;&amp;gt;&lt;br /&gt;
    ///   Receives a pointer to a null-terminated buffer that contains the path&lt;br /&gt;
    /// &amp;lt;/param&amp;gt;&lt;br /&gt;
    [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]&lt;br /&gt;
    void GetPath([In] uint flags, [MarshalAs(UnmanagedType.LPWStr)] out string path);&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;SetPath() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void SetPath_Stub();&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;GetLocation() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void GetLocation_Stub();&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;GetFolderType() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void GetFolderType_Stub();&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;GetRedirectionCapabilities() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void GetRedirectionCapabilities_Stub();&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;GetFolderDefinition() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void GetFolderDefinition_Stub();&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  #endregion // interface IKnownFolder&lt;br /&gt;
&lt;br /&gt;
  #region interface IKnownFolderManager&lt;br /&gt;
&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;Enumerates, creates and manages known folders&amp;lt;/summary&amp;gt;&lt;br /&gt;
  [&lt;br /&gt;
    ComImport,&lt;br /&gt;
    Guid(IID_IKnownFolderManager),&lt;br /&gt;
    InterfaceType(ComInterfaceType.InterfaceIsIUnknown)&lt;br /&gt;
  ]&lt;br /&gt;
  private interface IKnownFolderManager {&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;FolderIdFromCsidl() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void FolderIdFromCsidl_Stub();&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;FolderIdToCsidl() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void FolderIdToCsidl_Stub();&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;GetFolderIds() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void GetFolderIds_Stub();&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;Retrieves informations about a known folder by its id&amp;lt;/summary&amp;gt;&lt;br /&gt;
    /// &amp;lt;param name=&amp;quot;folderId&amp;quot;&amp;gt;&lt;br /&gt;
    ///   Id of the known folder whose informations will be retrieved&lt;br /&gt;
    /// &amp;lt;/param&amp;gt;&lt;br /&gt;
    /// &amp;lt;param name=&amp;quot;knownFolder&amp;quot;&amp;gt;Receives the known folder information instance&amp;lt;/param&amp;gt;&lt;br /&gt;
    [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]&lt;br /&gt;
    void GetFolder(&lt;br /&gt;
      [In] ref Guid folderId,&lt;br /&gt;
      [MarshalAs(UnmanagedType.Interface)] out IKnownFolder knownFolder&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;GetFolderByName() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void GetFolderByName_Stub();&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;RegisterFolder() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void RegisterFolder_Stub();&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;UnregisterFolder() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void UnregisterFolder_Stub();&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;FindFolderFromPath() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void FindFolderFromPath_Stub();&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;FindFolderFromIDList() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void FindFolderFromIDList_Stub();&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;Redirect() is not provided&amp;lt;/summary&amp;gt;&lt;br /&gt;
    void Redirect_Stub();&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  #endregion // interface IKnownFolderManager&lt;br /&gt;
&lt;br /&gt;
  #region class KnownFolderManagerImpl&lt;br /&gt;
&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;KnownFolderManager proxy coclass&amp;lt;/summary&amp;gt;&lt;br /&gt;
  [ComImport, Guid(CLSID_KnownFolderManager)]&lt;br /&gt;
  internal class KnownFolderManagerImpl { }&lt;br /&gt;
&lt;br /&gt;
  #endregion // class KnownFolderManagerImpl&lt;br /&gt;
&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;Directory, on Windows, where saved games should be stored&amp;lt;/summary&amp;gt;&lt;br /&gt;
  /// &amp;lt;remarks&amp;gt;&lt;br /&gt;
  ///   This public field is an example for quick testing and should be filled with&lt;br /&gt;
  ///   the saved game directory (eg. C:\Users\Me\Saved Games) if everything worked.&lt;br /&gt;
  /// &amp;lt;/remarks&amp;gt;&lt;br /&gt;
  public string SaveGameDirectory;&lt;br /&gt;
&lt;br /&gt;
  void Awake() {&lt;br /&gt;
    SaveGameDirectory = getSaveGameDirectory();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;Looks up the preferred save game directory for the current OS&amp;lt;/summary&amp;gt;&lt;br /&gt;
  /// &amp;lt;returns&amp;gt;The preferred save game directory&amp;lt;/returns&amp;gt;&lt;br /&gt;
  private static string getSaveGameDirectory() {&lt;br /&gt;
    bool isVistaOrLater = isAtLeastWindowsVersion(6, 0);&lt;br /&gt;
    if(isVistaOrLater) {&lt;br /&gt;
      try {&lt;br /&gt;
        string savedGameFolder = getKnownFolder(FOLDERID_SavedGames);&lt;br /&gt;
        if(!string.IsNullOrEmpty(savedGameFolder)) {&lt;br /&gt;
          return savedGameFolder;&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      catch(Exception) {&lt;br /&gt;
        // Something went wrong querying the folder, fall back to other means&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    try {&lt;br /&gt;
      string myDocumentsFolder = getSpecialFolder(CSIDL_PERSONAL);&lt;br /&gt;
      if(!string.IsNullOrEmpty(myDocumentsFolder)) {&lt;br /&gt;
        string myGamesPath = Path.Combine(myDocumentsFolder, &amp;quot;My Games&amp;quot;);&lt;br /&gt;
        if(!Directory.Exists(myGamesPath)) {&lt;br /&gt;
          Directory.CreateDirectory(myGamesPath);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        return myGamesPath;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    catch(Exception) {&lt;br /&gt;
      // Something went wrong querying the folder, fall back to other means&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Add more fallbacks here...&lt;br /&gt;
&lt;br /&gt;
    return null;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;Retrieves the path of a special folder by its CSIDL&amp;lt;/summary&amp;gt;&lt;br /&gt;
  /// &amp;lt;param name=&amp;quot;folderId&amp;quot;&amp;gt;&lt;br /&gt;
  ///   CSIDL of the special folder whose path will be retrieved&lt;br /&gt;
  /// &amp;lt;/param&amp;gt;&lt;br /&gt;
  /// &amp;lt;returns&amp;gt;The path of the special folder with the specified CSIDL&amp;lt;/returns&amp;gt;&lt;br /&gt;
  private static string getSpecialFolder(int folderId) {&lt;br /&gt;
    var path = new StringBuilder(MAX_PATH);&lt;br /&gt;
&lt;br /&gt;
    int result = SHGetSpecialFolderPath(IntPtr.Zero, path, folderId, 1);&lt;br /&gt;
    if(result == 0) {&lt;br /&gt;
      throw new Win32Exception(&amp;quot;Could not query special folder path&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return path.ToString();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;Retrieves the path of a known folder&amp;lt;/summary&amp;gt;&lt;br /&gt;
  /// &amp;lt;param name=&amp;quot;knownFolderId&amp;quot;&amp;gt;GUID of the known folderparam&amp;gt;&lt;br /&gt;
  /// &amp;lt;returns&amp;gt;The path of the known folder with the specified GUID&amp;lt;/returns&amp;gt;&lt;br /&gt;
  private static string getKnownFolder(Guid knownFolderId) {&lt;br /&gt;
    var instance = new KnownFolderManagerImpl();&lt;br /&gt;
    if(instance == null) {&lt;br /&gt;
      throw new COMException(&amp;quot;Could not create instance of known folder manager coclass&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    IKnownFolderManager knownFolderManager = instance as IKnownFolderManager;&lt;br /&gt;
    if(knownFolderManager == null) {&lt;br /&gt;
      throw new COMException(&amp;quot;Could not query known folder manager interface&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    IKnownFolder knownFolder;&lt;br /&gt;
    knownFolderManager.GetFolder(ref knownFolderId, out knownFolder);&lt;br /&gt;
    if(knownFolder == null) {&lt;br /&gt;
      throw new COMException(&amp;quot;Could not query known folder&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    string path;&lt;br /&gt;
    knownFolder.GetPath(0, out path);&lt;br /&gt;
    return path;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;&lt;br /&gt;
  ///   Determines if at least the specified operating system version is running&lt;br /&gt;
  /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
  /// &amp;lt;param name=&amp;quot;major&amp;quot;&amp;gt;Major version number of the required OS&amp;lt;/param&amp;gt;&lt;br /&gt;
  /// &amp;lt;param name=&amp;quot;minor&amp;quot;&amp;gt;Minor version number of the required OS&amp;lt;/param&amp;gt;&lt;br /&gt;
  /// &amp;lt;returns&amp;gt;True if at least the specified OS version is running&amp;lt;/returns&amp;gt;&lt;br /&gt;
  private static bool isAtLeastWindowsVersion(int major, int minor) {&lt;br /&gt;
    Version osVersion = Environment.OSVersion.Version;&lt;br /&gt;
&lt;br /&gt;
    return&lt;br /&gt;
      (osVersion.Major &amp;gt; major) ||&lt;br /&gt;
      ((osVersion.Major == major) &amp;amp;&amp;amp; (osVersion.Minor &amp;gt;= minor));&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Markus Ewald</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/Documentation_feedback</id>
		<title>Documentation feedback</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/Documentation_feedback"/>
				<updated>2013-04-01T05:51:20Z</updated>
		
		<summary type="html">&lt;p&gt;Sig: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page serves for errata, comments and general bashing of the official docs.unity3d.com documentation.&lt;br /&gt;
&lt;br /&gt;
Please remain civil and avoid swear words and personal insults to the impersonal documentation staff. They're probably doing as good a job as they can given whatever resource limitations they may have.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
=== Comments in example snippets ===&lt;br /&gt;
&lt;br /&gt;
How come the comments fall off when you switch from UnityScript to other languages? Can't the code generator keep the comments preceding the line where they were in the UnityScript source?&lt;br /&gt;
&lt;br /&gt;
Would it really be so expensive to write three sets of example snippets? They aren't overly verbose to begin with...&lt;br /&gt;
&lt;br /&gt;
:I'm pretty sure those aren't generated, there are three separate code samples written by humans. They probably just didn't have time/forgot to copy over the comments. [[User:Ppeterson|Ppeterson]] ([[User talk:Ppeterson|talk]]) 09:30, 1 April 2013 (CEST)&lt;br /&gt;
&lt;br /&gt;
== Specific articles ==&lt;br /&gt;
&lt;br /&gt;
=== [http://docs.unity3d.com/Documentation/ScriptReference/Quaternion.FromToRotation.html Quaternion.FromToRotation] ===&lt;br /&gt;
&lt;br /&gt;
The example code, when set as the sole line of a GameObject's Update, only makes it spin wildly.&lt;br /&gt;
&lt;br /&gt;
Reason may be a misunderstanding apparent from the comments - or, of course, that the snippet wasn't meant to do anything relevant to begin with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Sets the rotation so that the transform's y-axis goes along the z-axis&lt;br /&gt;
transform.rotation = Quaternion.FromToRotation(Vector3.up, transform.forward);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;... so that the transform's y-axis&amp;quot;; Vector3.up is the global coordinate y-axis, not the Transform's y-axis.&lt;br /&gt;
* &amp;quot;goes along the z-axis&amp;quot; of what exactly? Transform.forward at least indeed is the Transform's z-axis.&lt;br /&gt;
&lt;br /&gt;
=== [http://docs.unity3d.com/Documentation/ScriptReference/GUI.Button.html GUI.Button] ===&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
* Make a single press button. The user clicks '''them''' and something happens immediately.&lt;br /&gt;
** immediately?&lt;/div&gt;</summary>
		<author><name>Sig</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/ScreenCapture</id>
		<title>ScreenCapture</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/ScreenCapture"/>
				<updated>2013-03-30T03:19:04Z</updated>
		
		<summary type="html">&lt;p&gt;Venryx: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: C Sharp]]&lt;br /&gt;
[[Category: MonoBehaviour]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This is a script to let you easily use any of the three screen capture methods (Application.CaptureScreenshot, Texture2D.ReadPixels, or RenderTextures) to obtain a game screenshot. If you're simply saving the image to file, you can also choose to have the screen capture happen asynchronously, which reduces game lag.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
Just attach this script to an empty game object, and call the script instance's SaveScreenshot or GetScreenshot method.&lt;br /&gt;
&lt;br /&gt;
==C# - ScreenCapture.cs==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using UnityEngine;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.IO;&lt;br /&gt;
&lt;br /&gt;
public enum CaptureMethod&lt;br /&gt;
{&lt;br /&gt;
    AppCapture_Asynch,&lt;br /&gt;
    AppCapture_Synch,&lt;br /&gt;
    ReadPixels_Asynch,&lt;br /&gt;
    ReadPixels_Synch,&lt;br /&gt;
    RenderToTex_Asynch,&lt;br /&gt;
    RenderToTex_Synch&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public class ScreenCapture : MonoBehaviour&lt;br /&gt;
{&lt;br /&gt;
    /*void OnGUI() //For testing&lt;br /&gt;
    {&lt;br /&gt;
        if(GUI.Button(new Rect(100 * 0, 0, 100, 30), &amp;quot;AppCapture_Asynch&amp;quot;))&lt;br /&gt;
            SaveScreenshot(CaptureMethod.AppCapture_Asynch, Application.dataPath + &amp;quot;/screen1.png&amp;quot;);&lt;br /&gt;
        else if(GUI.Button(new Rect(100 * 1, 0, 100, 30), &amp;quot;AppCapture_Synch&amp;quot;))&lt;br /&gt;
            SaveScreenshot(CaptureMethod.AppCapture_Synch, Application.dataPath + &amp;quot;/screen2.png&amp;quot;);&lt;br /&gt;
        else if(GUI.Button(new Rect(100 * 2, 0, 100, 30), &amp;quot;ReadPixels_Asynch&amp;quot;))&lt;br /&gt;
            SaveScreenshot(CaptureMethod.ReadPixels_Asynch, Application.dataPath + &amp;quot;/screen3.png&amp;quot;);&lt;br /&gt;
        else if(GUI.Button(new Rect(100 * 3, 0, 100, 30), &amp;quot;ReadPixels_Synch&amp;quot;))&lt;br /&gt;
            SaveScreenshot(CaptureMethod.ReadPixels_Synch, Application.dataPath + &amp;quot;/screen4.png&amp;quot;);&lt;br /&gt;
        else if(GUI.Button(new Rect(100 * 4, 0, 100, 30), &amp;quot;RenderToTex_Asynch&amp;quot;))&lt;br /&gt;
            SaveScreenshot(CaptureMethod.RenderToTex_Asynch, Application.dataPath + &amp;quot;/screen5.png&amp;quot;);&lt;br /&gt;
        else if(GUI.Button(new Rect(100 * 5, 0, 100, 30), &amp;quot;RenderToTex_Synch&amp;quot;))&lt;br /&gt;
            SaveScreenshot(CaptureMethod.RenderToTex_Synch, Application.dataPath + &amp;quot;/screen6.png&amp;quot;);&lt;br /&gt;
    }*/&lt;br /&gt;
    &lt;br /&gt;
    public void SaveScreenshot(CaptureMethod method, string filePath)&lt;br /&gt;
    {&lt;br /&gt;
        if(method == CaptureMethod.AppCapture_Asynch)&lt;br /&gt;
        {&lt;br /&gt;
            Application.CaptureScreenshot(filePath);&lt;br /&gt;
        }&lt;br /&gt;
        else if(method == CaptureMethod.AppCapture_Synch)&lt;br /&gt;
        {&lt;br /&gt;
            Texture2D texture = GetScreenshot(CaptureMethod.AppCapture_Synch);&lt;br /&gt;
            byte[] bytes = texture.EncodeToPNG();&lt;br /&gt;
            File.WriteAllBytes(filePath, bytes);&lt;br /&gt;
        }&lt;br /&gt;
        else if(method == CaptureMethod.ReadPixels_Asynch)&lt;br /&gt;
        {&lt;br /&gt;
            StartCoroutine(SaveScreenshot_ReadPixelsAsynch(filePath));&lt;br /&gt;
        }&lt;br /&gt;
        else if(method == CaptureMethod.ReadPixels_Synch)&lt;br /&gt;
        {&lt;br /&gt;
            Texture2D texture = GetScreenshot(CaptureMethod.ReadPixels_Synch);&lt;br /&gt;
            &lt;br /&gt;
            byte[] bytes = texture.EncodeToPNG();&lt;br /&gt;
 &lt;br /&gt;
            //Save our test image (could also upload to WWW)&lt;br /&gt;
            File.WriteAllBytes(filePath, bytes);&lt;br /&gt;
     &lt;br /&gt;
            //Tell unity to delete the texture, by default it seems to keep hold of it and memory crashes will occur after too many screenshots.&lt;br /&gt;
            DestroyObject(texture);&lt;br /&gt;
        }&lt;br /&gt;
        else if(method == CaptureMethod.RenderToTex_Asynch)&lt;br /&gt;
        {&lt;br /&gt;
            StartCoroutine(SaveScreenshot_RenderToTexAsynch(filePath));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            Texture2D screenShot = GetScreenshot(CaptureMethod.RenderToTex_Synch);&lt;br /&gt;
            byte[] bytes = screenShot.EncodeToPNG();&lt;br /&gt;
            File.WriteAllBytes(filePath, bytes);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    private IEnumerator SaveScreenshot_ReadPixelsAsynch(string filePath)&lt;br /&gt;
    {&lt;br /&gt;
        //Wait for graphics to render&lt;br /&gt;
        yield return new WaitForEndOfFrame();&lt;br /&gt;
 &lt;br /&gt;
        //Create a texture to pass to encoding&lt;br /&gt;
        Texture2D texture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false);&lt;br /&gt;
&lt;br /&gt;
        //Put buffer into texture&lt;br /&gt;
        texture.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0);&lt;br /&gt;
    &lt;br /&gt;
        //Split the process up--ReadPixels() and the GetPixels() call inside of the encoder are both pretty heavy&lt;br /&gt;
        yield return 0;&lt;br /&gt;
            &lt;br /&gt;
        byte[] bytes = texture.EncodeToPNG();&lt;br /&gt;
&lt;br /&gt;
        //Save our test image (could also upload to WWW)&lt;br /&gt;
        File.WriteAllBytes(filePath, bytes);&lt;br /&gt;
 &lt;br /&gt;
        //Tell unity to delete the texture, by default it seems to keep hold of it and memory crashes will occur after too many screenshots.&lt;br /&gt;
        DestroyObject(texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    private IEnumerator SaveScreenshot_RenderToTexAsynch(string filePath)&lt;br /&gt;
    {&lt;br /&gt;
        //Wait for graphics to render&lt;br /&gt;
        yield return new WaitForEndOfFrame();&lt;br /&gt;
        &lt;br /&gt;
        RenderTexture rt = new RenderTexture(Screen.width, Screen.height, 24);        &lt;br /&gt;
        Texture2D screenShot = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false);&lt;br /&gt;
        &lt;br /&gt;
        //Camera.main.targetTexture = rt;&lt;br /&gt;
        //Camera.main.Render();&lt;br /&gt;
        &lt;br /&gt;
        //Render from all!&lt;br /&gt;
        foreach(Camera cam in Camera.allCameras)&lt;br /&gt;
        {&lt;br /&gt;
            cam.targetTexture = rt;&lt;br /&gt;
            cam.Render();&lt;br /&gt;
            cam.targetTexture = null;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        RenderTexture.active = rt;        &lt;br /&gt;
        screenShot.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0);&lt;br /&gt;
        Camera.main.targetTexture = null;&lt;br /&gt;
        RenderTexture.active = null; //Added to avoid errors&lt;br /&gt;
        Destroy(rt);&lt;br /&gt;
        &lt;br /&gt;
        //Split the process up&lt;br /&gt;
        yield return 0;&lt;br /&gt;
        &lt;br /&gt;
        byte[] bytes = screenShot.EncodeToPNG();&lt;br /&gt;
        File.WriteAllBytes(filePath, bytes);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    private static int tempFileCount = 0;&lt;br /&gt;
    ///&amp;lt;summary&amp;gt;Must use a Synch capture type to work.&amp;lt;/summary&amp;gt;&lt;br /&gt;
    public Texture2D GetScreenshot(CaptureMethod method)&lt;br /&gt;
    {&lt;br /&gt;
        if(method == CaptureMethod.AppCapture_Synch)&lt;br /&gt;
        {&lt;br /&gt;
            string tempFilePath = System.Environment.GetEnvironmentVariable(&amp;quot;TEMP&amp;quot;) + &amp;quot;/screenshotBuffer&amp;quot; + tempFileCount + &amp;quot;.png&amp;quot;;&lt;br /&gt;
            tempFileCount++;&lt;br /&gt;
            Application.CaptureScreenshot(tempFilePath);&lt;br /&gt;
            WWW www = new WWW(&amp;quot;file://&amp;quot; + tempFilePath.Replace(Path.DirectorySeparatorChar.ToString(), &amp;quot;/&amp;quot;));&lt;br /&gt;
            &lt;br /&gt;
            Texture2D texture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false);&lt;br /&gt;
            while (!www.isDone) {}&lt;br /&gt;
            www.LoadImageIntoTexture((Texture2D)texture);&lt;br /&gt;
            File.Delete(tempFilePath); //Can delete now&lt;br /&gt;
            &lt;br /&gt;
            return texture;&lt;br /&gt;
        }&lt;br /&gt;
        else if(method == CaptureMethod.ReadPixels_Synch)&lt;br /&gt;
        {&lt;br /&gt;
            //Create a texture to pass to encoding&lt;br /&gt;
            Texture2D texture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false);&lt;br /&gt;
    &lt;br /&gt;
            //Put buffer into texture&lt;br /&gt;
            texture.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0); //Unity complains about this line's call being made &amp;quot;while not inside drawing frame&amp;quot;, but it works just fine.*&lt;br /&gt;
            &lt;br /&gt;
            return texture;&lt;br /&gt;
        }&lt;br /&gt;
        else if(method == CaptureMethod.RenderToTex_Synch)&lt;br /&gt;
        {&lt;br /&gt;
            RenderTexture rt = new RenderTexture(Screen.width, Screen.height, 24);&lt;br /&gt;
            Texture2D screenShot = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false);&lt;br /&gt;
            &lt;br /&gt;
            //Camera.main.targetTexture = rt;&lt;br /&gt;
            //Camera.main.Render();&lt;br /&gt;
            &lt;br /&gt;
            //Render from all!&lt;br /&gt;
            foreach(Camera cam in Camera.allCameras)&lt;br /&gt;
            {&lt;br /&gt;
                cam.targetTexture = rt;&lt;br /&gt;
                cam.Render();&lt;br /&gt;
                cam.targetTexture = null;&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            RenderTexture.active = rt;            &lt;br /&gt;
            screenShot.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0);&lt;br /&gt;
            Camera.main.targetTexture = null;&lt;br /&gt;
            RenderTexture.active = null; //Added to avoid errors&lt;br /&gt;
            Destroy(rt);&lt;br /&gt;
            &lt;br /&gt;
            return screenShot;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            return null;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Venryx</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/Distance_from_a_point_to_a_rectangle</id>
		<title>Distance from a point to a rectangle</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/Distance_from_a_point_to_a_rectangle"/>
				<updated>2013-03-29T22:23:48Z</updated>
		
		<summary type="html">&lt;p&gt;Ppeterson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Function ==&lt;br /&gt;
This script computes the distance between a point and a rectangle. It's a 2D computation so it's assumed that the point and rectangle lie in a plane. If the point is inside the rectangle, the distance returned is 0.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
This is part of a larger framework I worked on called the Cygnet Engine. It's a math function, so I put it in a class called CygnetMath. I may release other parts of Cygnet in the future, but for now, this is the only part.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The class is designed for use in Unity's GUI coordinates. With this coordinate system, the origin is at the top left of the screen, x values increase from left to right, and y values increase as you go DOWN the screen. If you do some careful coordinate transformations, you probably should be able to use the code with an arbitrary coordinate system, but this was not the usage I designed it for, so beware.&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
There are several ways to compute the distance. This one determines if the point is either (a) within the rectangle (b) closest to an edge (c) closest to a corner. This is done by splitting the area around the rectangle into 9 regions, and doing a few branches. It may not be the most efficient way. If not, let me know or edit this page.&lt;br /&gt;
&lt;br /&gt;
== Original Author ==&lt;br /&gt;
[[User_talk:Ppeterson|Philip Peterson]] (i.e. who to send bug reports to)&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
It's written in C#. Sorry.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
partial class CygnetMath {&lt;br /&gt;
    public static float DistancePointToRectangle(Vector2 point, Rect rect) {&lt;br /&gt;
        //  Calculate a distance between a point and a rectangle.&lt;br /&gt;
        //  The area around/in the rectangle is defined in terms of&lt;br /&gt;
        //  several regions:&lt;br /&gt;
        //&lt;br /&gt;
        //  O--x&lt;br /&gt;
        //  |&lt;br /&gt;
        //  y&lt;br /&gt;
        //&lt;br /&gt;
        //&lt;br /&gt;
        //        I   |    II    |  III&lt;br /&gt;
        //      ======+==========+======   --yMin&lt;br /&gt;
        //       VIII |  IX (in) |  IV&lt;br /&gt;
        //      ======+==========+======   --yMax&lt;br /&gt;
        //       VII  |    VI    |   V&lt;br /&gt;
        //&lt;br /&gt;
        //&lt;br /&gt;
        //  Note that the +y direction is down because of Unity's GUI coordinates.&lt;br /&gt;
&lt;br /&gt;
        if (point.x &amp;lt; rect.xMin) { // Region I, VIII, or VII&lt;br /&gt;
            if (point.y &amp;lt; rect.yMin) { // I&lt;br /&gt;
                Vector2 diff = point - new Vector2(rect.xMin, rect.yMin);&lt;br /&gt;
                return diff.magnitude;&lt;br /&gt;
            }&lt;br /&gt;
            else if (point.y &amp;gt; rect.yMax) { // VII&lt;br /&gt;
                Vector2 diff = point - new Vector2(rect.xMin, rect.yMax);&lt;br /&gt;
                return diff.magnitude;&lt;br /&gt;
            }&lt;br /&gt;
            else { // VIII&lt;br /&gt;
                return rect.xMin - point.x;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else if (point.x &amp;gt; rect.xMax) { // Region III, IV, or V&lt;br /&gt;
            if (point.y &amp;lt; rect.yMin) { // III&lt;br /&gt;
                Vector2 diff = point - new Vector2(rect.xMax, rect.yMin);&lt;br /&gt;
                return diff.magnitude;&lt;br /&gt;
            }&lt;br /&gt;
            else if (point.y &amp;gt; rect.yMax) { // V&lt;br /&gt;
                Vector2 diff = point - new Vector2(rect.xMax, rect.yMax);&lt;br /&gt;
                return diff.magnitude;&lt;br /&gt;
            }&lt;br /&gt;
            else { // IV&lt;br /&gt;
                return point.x - rect.xMax;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else { // Region II, IX, or VI&lt;br /&gt;
            if (point.y &amp;lt; rect.yMin) { // II&lt;br /&gt;
                return rect.yMin - point.y;&lt;br /&gt;
            }&lt;br /&gt;
            else if (point.y &amp;gt; rect.yMax) { // VI&lt;br /&gt;
                return point.y - rect.yMax;&lt;br /&gt;
            }&lt;br /&gt;
            else { // IX&lt;br /&gt;
                return 0f;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== License == &lt;br /&gt;
This code is released under the [http://opensource.org/licenses/MIT MIT license]. Please provide attribution to the original author, Philip Peterson.&lt;br /&gt;
&lt;br /&gt;
[[Category:Algorithms]]&lt;br /&gt;
[[Category:Utility]]&lt;/div&gt;</summary>
		<author><name>Ppeterson</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/TerrainTransparency</id>
		<title>TerrainTransparency</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/TerrainTransparency"/>
				<updated>2013-03-26T01:58:25Z</updated>
		
		<summary type="html">&lt;p&gt;Venryx: Converted tabs to spaces.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Unity 3.x shaders]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This is a shader to allow transparent textures on terrains. It does this by overriding the terrain shader, checking for a transparent texture, and, if it finds one, adjusting the terrain's visibility to the transparent texture's splatmap opacity data.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Enables the use of a transparent texture on the terrain.&lt;br /&gt;
&lt;br /&gt;
The main use of this shader is for adding 'holes' or 'caves' to terrains, although you can also use it for making terrain areas partially transparent, or for making a terrain non-rectangular.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
* Copy the shader code below and paste it into a new shader file within your project's Assets folder. (you can name it whatever you want)&lt;br /&gt;
* Create a completely transparent image and add it as one of your terrain's textures.&lt;br /&gt;
* Paint the transparent texture onto your terrain, and wherever you paint, the terrain will become transparent!&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* For the transparency to work, you must place the transparent texture into one of the first four slots. (technical reason; the 'first pass' shader that is overridden can only access the first four splatmaps)&lt;br /&gt;
* If you apply the transparent texture with only partial opacity, you can make existing textures 'partially transparency'.&lt;br /&gt;
* To remove the transparency, just paint over it with another texture.&lt;br /&gt;
* The terrain collider will still be active on transparent parts of the terrain. To fix this, you would need to make a script that disables the collider when the player is over a transparent area.&lt;br /&gt;
&lt;br /&gt;
==Shader - TerrainTransparency.shader==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;Shader &amp;quot;Nature/Terrain/Diffuse&amp;quot;&lt;br /&gt;
{&lt;br /&gt;
    Properties&lt;br /&gt;
    {&lt;br /&gt;
        [HideInInspector] _Control (&amp;quot;Control (RGBA)&amp;quot;, 2D) = &amp;quot;red&amp;quot; {}&lt;br /&gt;
        [HideInInspector] _Splat3 (&amp;quot;Layer 3 (A)&amp;quot;, 2D) = &amp;quot;white&amp;quot; {}&lt;br /&gt;
        [HideInInspector] _Splat2 (&amp;quot;Layer 2 (B)&amp;quot;, 2D) = &amp;quot;white&amp;quot; {}&lt;br /&gt;
        [HideInInspector] _Splat1 (&amp;quot;Layer 1 (G)&amp;quot;, 2D) = &amp;quot;white&amp;quot; {}&lt;br /&gt;
        [HideInInspector] _Splat0 (&amp;quot;Layer 0 (R)&amp;quot;, 2D) = &amp;quot;white&amp;quot; {}&lt;br /&gt;
        //Used in fallback on old cards &amp;amp; base map&lt;br /&gt;
        [HideInInspector] _MainTex (&amp;quot;BaseMap (RGB)&amp;quot;, 2D) = &amp;quot;white&amp;quot; {}&lt;br /&gt;
        [HideInInspector] _Color (&amp;quot;Main Color&amp;quot;, Color) = (1,1,1,1)&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    SubShader&lt;br /&gt;
    {&lt;br /&gt;
        Tags&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;SplatCount&amp;quot; = &amp;quot;4&amp;quot;&lt;br /&gt;
            &amp;quot;Queue&amp;quot; = &amp;quot;Geometry-100&amp;quot;&lt;br /&gt;
            &amp;quot;RenderType&amp;quot; = &amp;quot;Opaque&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        Blend SrcAlpha OneMinusSrcAlpha&lt;br /&gt;
        CGPROGRAM&lt;br /&gt;
        #pragma surface surf Lambert&lt;br /&gt;
        struct Input&lt;br /&gt;
        {&lt;br /&gt;
            float2 uv_Control : TEXCOORD0;&lt;br /&gt;
            float2 uv_Splat0 : TEXCOORD1;&lt;br /&gt;
            float2 uv_Splat1 : TEXCOORD2;&lt;br /&gt;
            float2 uv_Splat2 : TEXCOORD3;&lt;br /&gt;
            float2 uv_Splat3 : TEXCOORD4;&lt;br /&gt;
        };&lt;br /&gt;
        &lt;br /&gt;
        sampler2D _Control;&lt;br /&gt;
        sampler2D _Splat0,_Splat1,_Splat2,_Splat3;&lt;br /&gt;
        &lt;br /&gt;
        void surf (Input IN, inout SurfaceOutput o)&lt;br /&gt;
        {&lt;br /&gt;
            fixed4 splat_control = tex2D (_Control, IN.uv_Control);&lt;br /&gt;
            fixed4 firstSplat = tex2D (_Splat0, IN.uv_Splat0);&lt;br /&gt;
            fixed3 col;&lt;br /&gt;
            col = splat_control.r * tex2D (_Splat0, IN.uv_Splat0).rgb;&lt;br /&gt;
            col += splat_control.g * tex2D (_Splat1, IN.uv_Splat1).rgb;&lt;br /&gt;
            col += splat_control.b * tex2D (_Splat2, IN.uv_Splat2).rgb;&lt;br /&gt;
            col += splat_control.a * tex2D (_Splat3, IN.uv_Splat3).rgb;&lt;br /&gt;
            o.Albedo = col;&lt;br /&gt;
            o.Alpha = 1;&lt;br /&gt;
            if(tex2D(_Splat0, IN.uv_Splat0).a == 0)&lt;br /&gt;
                o.Alpha = 1 - splat_control.r;&lt;br /&gt;
            else if(tex2D(_Splat1, IN.uv_Splat1).a == 0)&lt;br /&gt;
                o.Alpha = 1 - splat_control.g;&lt;br /&gt;
            else if(tex2D(_Splat2, IN.uv_Splat2).a == 0)&lt;br /&gt;
                o.Alpha = 1 - splat_control.b;&lt;br /&gt;
            else if(tex2D(_Splat3, IN.uv_Splat3).a == 0)&lt;br /&gt;
                o.Alpha = 1 - splat_control.a;&lt;br /&gt;
        }&lt;br /&gt;
        ENDCG&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Dependency &amp;quot;AddPassShader&amp;quot; = &amp;quot;Hidden/TerrainEngine/Splatmap/Lightmap-AddPass&amp;quot;&lt;br /&gt;
    Dependency &amp;quot;BaseMapShader&amp;quot; = &amp;quot;Diffuse&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    //Fallback to Diffuse&lt;br /&gt;
    Fallback &amp;quot;Diffuse&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Venryx</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/SceneAutoLoader</id>
		<title>SceneAutoLoader</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/SceneAutoLoader"/>
				<updated>2013-03-07T21:01:35Z</updated>
		
		<summary type="html">&lt;p&gt;Yoyo: initial revision of scene auto loader editor script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author: [[User:Yoyo]]&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
This editor script lets you work in one scene but load another one when you press play in the Unity Editor. This functionality is useful when you are working on a scene for a level or section of the world, but you need to load a different &amp;quot;master scene&amp;quot; in order to play your game. By automatically switching to and from the master scene when you press play in the editor, the scene auto-loader speeds up your workflow.&lt;br /&gt;
&lt;br /&gt;
This script is a complete reimplementation of an idea discussed on [http://forum.unity3d.com/threads/157502-Executing-first-scene-in-build-settings-when-pressing-play-button-in-editor this forum thread].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Save the script below as Assets/Editor/SceneAutoLoader.cs. The script will be automatically activated when you open your project, creating a &amp;quot;Scene Autoload&amp;quot; sub-menu on the Unity Editor File menu.&lt;br /&gt;
&lt;br /&gt;
The menu options are:&lt;br /&gt;
* Select Master Scene... - choose the scene that should be loaded when you press play&lt;br /&gt;
* Load Master On Play - select this to auto-load your master scene (if greyed out then this is the active option)&lt;br /&gt;
* Don't Load Master On Play - select this to disable auto-load of your master scene (if greyed out then this is the active option)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This script is tested, but as with all community scripts, usage is at your own risk.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How It Works ==&lt;br /&gt;
&lt;br /&gt;
The script uses [http://docs.unity3d.com/Documentation/Manual/RunningEditorCodeOnLaunch.html InitializeOnLoad] to auto-run its [http://msdn.microsoft.com/en-us/library/k9x6w0hc(v=vs.110).aspx static constructor], which attaches a callback to [http://docs.unity3d.com/Documentation/ScriptReference/EditorApplication-playmodeStateChanged.html EditorApplication.playmodeStateChanged]. This callback will load the designated master scene when the user presses play, and reload the previous scene when they press stop.&lt;br /&gt;
&lt;br /&gt;
Menu items are created to select the master scene, using [http://docs.unity3d.com/Documentation/ScriptReference/EditorUtility.OpenFilePanel.html EditorUtility.OpenFilePanel], and to enabled and disable auto-loading of the master scene.&lt;br /&gt;
&lt;br /&gt;
Before auto-loading the master scene, [http://docs.unity3d.com/Documentation/ScriptReference/EditorApplication.SaveCurrentSceneIfUserWantsTo.html EditorApplication.SaveCurrentSceneIfUserWantsTo] is used to make sure edits in the sub-scene aren't thrown away without the user knowing. If the user chooses to cancel the save scene operation then the editor play operation is also cancelled.&lt;br /&gt;
&lt;br /&gt;
[http://docs.unity3d.com/Documentation/ScriptReference/EditorPrefs.html EditorPrefs] are used to remember the user's auto-loading preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Update ==&lt;br /&gt;
&lt;br /&gt;
March 7, 2013: Initial revision.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== C# - SceneAutoLoader.cs ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEditor;&lt;br /&gt;
&lt;br /&gt;
/// &amp;lt;summary&amp;gt;&lt;br /&gt;
/// Scene auto loader.&lt;br /&gt;
/// &amp;lt;/summary&amp;gt;&lt;br /&gt;
/// &amp;lt;description&amp;gt;&lt;br /&gt;
/// This class adds a File &amp;gt; Scene Autoload menu containing options to select&lt;br /&gt;
/// a &amp;quot;master scene&amp;quot; enable it to be auto-loaded when the user presses play&lt;br /&gt;
/// in the editor. When enabled, the selected scene will be loaded on play,&lt;br /&gt;
/// then the original scene will be reloaded on stop.&lt;br /&gt;
///&lt;br /&gt;
/// Based on an idea on this thread:&lt;br /&gt;
/// http://forum.unity3d.com/threads/157502-Executing-first-scene-in-build-settings-when-pressing-play-button-in-editor&lt;br /&gt;
/// &amp;lt;/description&amp;gt;&lt;br /&gt;
[InitializeOnLoad]&lt;br /&gt;
static class SceneAutoLoader&lt;br /&gt;
{&lt;br /&gt;
    // Static constructor binds a playmode-changed callback.&lt;br /&gt;
    // [InitializeOnLoad] above makes sure this gets executed.&lt;br /&gt;
    static SceneAutoLoader()&lt;br /&gt;
    {&lt;br /&gt;
        EditorApplication.playmodeStateChanged += OnPlayModeChanged;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Menu items to select the &amp;quot;master&amp;quot; scene and control whether or not to load it.&lt;br /&gt;
    [MenuItem(&amp;quot;File/Scene Autoload/Select Master Scene...&amp;quot;)]&lt;br /&gt;
    private static void SelectMasterScene()&lt;br /&gt;
    {&lt;br /&gt;
        string masterScene = EditorUtility.OpenFilePanel(&amp;quot;Select Master Scene&amp;quot;, Application.dataPath, &amp;quot;unity&amp;quot;);&lt;br /&gt;
        if (!string.IsNullOrEmpty(masterScene))&lt;br /&gt;
        {&lt;br /&gt;
            MasterScene = masterScene;&lt;br /&gt;
            LoadMasterOnPlay = true;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    [MenuItem(&amp;quot;File/Scene Autoload/Load Master On Play&amp;quot;, true)]&lt;br /&gt;
    private static bool ShowLoadMasterOnPlay()&lt;br /&gt;
    {&lt;br /&gt;
        return !LoadMasterOnPlay;&lt;br /&gt;
    }&lt;br /&gt;
    [MenuItem(&amp;quot;File/Scene Autoload/Load Master On Play&amp;quot;)]&lt;br /&gt;
    private static void EnableLoadMasterOnPlay()&lt;br /&gt;
    {&lt;br /&gt;
        LoadMasterOnPlay = true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    [MenuItem(&amp;quot;File/Scene Autoload/Don't Load Master On Play&amp;quot;, true)]&lt;br /&gt;
    private static bool ShowDontLoadMasterOnPlay()&lt;br /&gt;
    {&lt;br /&gt;
        return LoadMasterOnPlay;&lt;br /&gt;
    }&lt;br /&gt;
    [MenuItem(&amp;quot;File/Scene Autoload/Don't Load Master On Play&amp;quot;)]&lt;br /&gt;
    private static void DisableLoadMasterOnPlay()&lt;br /&gt;
    {&lt;br /&gt;
        LoadMasterOnPlay = false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Play mode change callback handles the scene load/reload.&lt;br /&gt;
    private static void OnPlayModeChanged()&lt;br /&gt;
    {&lt;br /&gt;
        if (!LoadMasterOnPlay)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (!EditorApplication.isPlaying &amp;amp;&amp;amp; EditorApplication.isPlayingOrWillChangePlaymode)&lt;br /&gt;
        {&lt;br /&gt;
            // User pressed play -- autoload master scene.&lt;br /&gt;
            PreviousScene = EditorApplication.currentScene;&lt;br /&gt;
            if (EditorApplication.SaveCurrentSceneIfUserWantsTo())&lt;br /&gt;
            {&lt;br /&gt;
                if (!EditorApplication.OpenScene(MasterScene))&lt;br /&gt;
                {&lt;br /&gt;
                    Debug.LogError(string.Format(&amp;quot;error: scene not found: {0}&amp;quot;, MasterScene));&lt;br /&gt;
                    EditorApplication.isPlaying = false;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // User cancelled the save operation -- cancel play as well.&lt;br /&gt;
                EditorApplication.isPlaying = false;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        if (EditorApplication.isPlaying &amp;amp;&amp;amp; !EditorApplication.isPlayingOrWillChangePlaymode)&lt;br /&gt;
        {&lt;br /&gt;
            // User pressed stop -- reload previous scene.&lt;br /&gt;
            if (!EditorApplication.OpenScene(PreviousScene))&lt;br /&gt;
            {&lt;br /&gt;
                Debug.LogError(string.Format(&amp;quot;error: scene not found: {0}&amp;quot;, PreviousScene));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Properties are remembered as editor preferences.&lt;br /&gt;
    private const string cEditorPrefLoadMasterOnPlay = &amp;quot;SceneAutoLoader.LoadMasterOnPlay&amp;quot;;&lt;br /&gt;
    private const string cEditorPrefMasterScene = &amp;quot;SceneAutoLoader.MasterScene&amp;quot;;&lt;br /&gt;
    private const string cEditorPrefPreviousScene = &amp;quot;SceneAutoLoader.PreviousScene&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    private static bool LoadMasterOnPlay&lt;br /&gt;
    {&lt;br /&gt;
        get { return EditorPrefs.GetBool(cEditorPrefLoadMasterOnPlay, false); }&lt;br /&gt;
        set { EditorPrefs.SetBool(cEditorPrefLoadMasterOnPlay, value); }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    private static string MasterScene&lt;br /&gt;
    {&lt;br /&gt;
        get { return EditorPrefs.GetString(cEditorPrefMasterScene, &amp;quot;Master.unity&amp;quot;); }&lt;br /&gt;
        set { EditorPrefs.SetString(cEditorPrefMasterScene, value); }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    private static string PreviousScene&lt;br /&gt;
    {&lt;br /&gt;
        get { return EditorPrefs.GetString(cEditorPrefPreviousScene, EditorApplication.currentScene); }&lt;br /&gt;
        set { EditorPrefs.SetString(cEditorPrefPreviousScene, value); }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[Category:Editor Scripts]]&lt;br /&gt;
[[Category:C Sharp]]&lt;/div&gt;</summary>
		<author><name>Yoyo</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/DelayedMessage</id>
		<title>DelayedMessage</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/DelayedMessage"/>
				<updated>2013-03-07T11:46:42Z</updated>
		
		<summary type="html">&lt;p&gt;Dock: /* C# - DelayedMessage.cs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: MonoBehaviour]]&lt;br /&gt;
[[Category: C Sharp]]&lt;br /&gt;
Author: Hayden Scott-Baron (Dock)&lt;br /&gt;
==Description==&lt;br /&gt;
A simple script to call a message on an object after a while. &lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
Place this script on the gameobject you wish to have call a function later on. &lt;br /&gt;
Useful for Destroying an old object, for example, or for allowing objects to repeatedly fade in/out using the [[FadeObjectInOut]] script. &lt;br /&gt;
&lt;br /&gt;
==Technical Discussion==&lt;br /&gt;
Set the initial time to negative to reduce the initial wait. &lt;br /&gt;
&lt;br /&gt;
==C# - DelayedMessage.cs==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
	DelayedMessage.cs&lt;br /&gt;
 	Hayden Scott-Baron (Dock) - http://starfruitgames.com&lt;br /&gt;
 	7 Mar 2013 &lt;br /&gt;
 &lt;br /&gt;
	This uses 'SendMessage' on an object after a delay. &lt;br /&gt;
 	You can send a value such as a string, int or float&lt;br /&gt;
 	You may also set this to repeat a message on an object. &lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class DelayedMessage : MonoBehaviour &lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	public enum MessageType&lt;br /&gt;
	{&lt;br /&gt;
		No_Values,&lt;br /&gt;
		Send_Int,&lt;br /&gt;
		Send_String,&lt;br /&gt;
		Send_Float,&lt;br /&gt;
	}&lt;br /&gt;
	public MessageType typeOfMessage = MessageType.No_Values;  &lt;br /&gt;
&lt;br /&gt;
	public float delayTime = 1.0f; &lt;br /&gt;
	public string message = &amp;quot;&amp;quot;; &lt;br /&gt;
	&lt;br /&gt;
	public int valueInt; &lt;br /&gt;
	public float valueFloat; &lt;br /&gt;
	public string valueString; &lt;br /&gt;
&lt;br /&gt;
	public SendMessageOptions messageOptions = SendMessageOptions.DontRequireReceiver; &lt;br /&gt;
&lt;br /&gt;
	public float initialDelay = 0.0f; 	&lt;br /&gt;
	public bool repeatMessage = false; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	private bool startNow = true; &lt;br /&gt;
	private float timer = 0.0f; &lt;br /&gt;
&lt;br /&gt;
	IEnumerator MessageSequence ()&lt;br /&gt;
	{&lt;br /&gt;
		timer += delayTime; &lt;br /&gt;
&lt;br /&gt;
		while (timer &amp;gt; 0.0f)&lt;br /&gt;
		{&lt;br /&gt;
			yield return null; &lt;br /&gt;
			timer -= Time.deltaTime; &lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		SendMessageNow (); &lt;br /&gt;
&lt;br /&gt;
		if (repeatMessage)&lt;br /&gt;
			startNow = true; &lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	void SendMessageNow()&lt;br /&gt;
	{&lt;br /&gt;
		switch (typeOfMessage)&lt;br /&gt;
		{&lt;br /&gt;
		case MessageType.No_Values:&lt;br /&gt;
			SendMessage (message, messageOptions); &lt;br /&gt;
			break; &lt;br /&gt;
&lt;br /&gt;
		case MessageType.Send_Float:&lt;br /&gt;
			SendMessage (message, valueFloat, messageOptions); &lt;br /&gt;
			break; &lt;br /&gt;
&lt;br /&gt;
		case MessageType.Send_Int:&lt;br /&gt;
			SendMessage (message, valueInt, messageOptions); &lt;br /&gt;
			break; &lt;br /&gt;
&lt;br /&gt;
		case MessageType.Send_String:&lt;br /&gt;
			SendMessage (message, valueString, messageOptions); &lt;br /&gt;
			break; &lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	void Awake ()&lt;br /&gt;
	{&lt;br /&gt;
		if (message == &amp;quot;&amp;quot;)&lt;br /&gt;
			Debug.LogError (&amp;quot;Warning! No message on 'Delayed Message' object!&amp;quot;, gameObject); &lt;br /&gt;
&lt;br /&gt;
		timer += initialDelay;&lt;br /&gt;
		startNow = true; &lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	void Update ()&lt;br /&gt;
	{&lt;br /&gt;
		if (startNow)&lt;br /&gt;
		{&lt;br /&gt;
			startNow = false; &lt;br /&gt;
			StartCoroutine ( &amp;quot;MessageSequence&amp;quot; ); &lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dock</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/SurfaceReflection</id>
		<title>SurfaceReflection</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/SurfaceReflection"/>
				<updated>2013-03-07T03:04:26Z</updated>
		
		<summary type="html">&lt;p&gt;Venryx: Converted tabs to spaces.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Unity 2.x shaders]]&lt;br /&gt;
[[Category: Unity Pro shaders]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This is a shader/script to add realtime reflections to flat surfaces. It uses a RenderCamera to do this, thus requiring Unity Pro.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Creates realtime reflections based on actual scene objects instead of cubemaps. (meaning it works on its own and is dynamic)&lt;br /&gt;
* Supports the adding of a base texture to be drawn underneath, meaning you can use this script to add reflections to surfaces with existing textures.&lt;br /&gt;
* Has opacity settings for both the base texture and the reflections, letting you customize the overall surface opacity as well as the visibility ratio between base texture and reflections.&lt;br /&gt;
* Has a tint color option for changing the brightness of the surface or adding color.&lt;br /&gt;
&lt;br /&gt;
This shader/script is based on the [[MirrorReflection2]] shader/script written by [[User:NeARAZ|Aras Pranckevicius]].&lt;br /&gt;
&lt;br /&gt;
With its additional features/options, this shader/script can be used to add reflections without removing the surface's transparency or existing texture, letting you create reflective windows and textured mirrors.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
Prerequisites: This technique requires Unity Pro, version 2 or newer.&lt;br /&gt;
&lt;br /&gt;
* Create a material that uses the shader below (FX/Surface Reflection).&lt;br /&gt;
* Apply the material to a plane-like (i.e. flat) object.&lt;br /&gt;
* Attach the SurfaceReflection.cs script to the object.&lt;br /&gt;
* Set the object's layer to 'Water'. (optional but recommended)&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* The reflection happens '''along the object's 'up' direction''' by default (green axis in the scene view). (e.g. the built-in plane object is suitable for use as a mirror) If you experience weird reflections, try enabling the script's &amp;quot;Normals From Mesh&amp;quot; option. If the problem persists, try correcting the surface's orientation/axis-direction manually.&lt;br /&gt;
* If you use this on multiple surfaces, you have to create a separate material for each one, otherwise their reflections will be disrupted when both in view.&lt;br /&gt;
&lt;br /&gt;
==Shader - SurfaceReflection.shader==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;Shader &amp;quot;FX/Surface Reflection&amp;quot;&lt;br /&gt;
{ &lt;br /&gt;
    Properties&lt;br /&gt;
    {&lt;br /&gt;
        _MainAlpha(&amp;quot;MainAlpha&amp;quot;, Range(0, 1)) = 1&lt;br /&gt;
        _ReflectionAlpha(&amp;quot;ReflectionAlpha&amp;quot;, Range(0, 1)) = 1&lt;br /&gt;
        _TintColor (&amp;quot;Tint Color (RGB)&amp;quot;, Color) = (1,1,1)&lt;br /&gt;
        _MainTex (&amp;quot;MainTex (RGBA)&amp;quot;, 2D) = &amp;quot;&amp;quot;&lt;br /&gt;
        _ReflectionTex (&amp;quot;ReflectionTex&amp;quot;, 2D) = &amp;quot;white&amp;quot; { TexGen ObjectLinear }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    //Two texture cards: full thing&lt;br /&gt;
    Subshader&lt;br /&gt;
    { &lt;br /&gt;
        Tags {Queue = Transparent}&lt;br /&gt;
        ZWrite Off&lt;br /&gt;
        Colormask RGBA&lt;br /&gt;
        Color [_TintColor]&lt;br /&gt;
        Blend SrcAlpha OneMinusSrcAlpha&lt;br /&gt;
        Pass&lt;br /&gt;
        {&lt;br /&gt;
            SetTexture[_ReflectionTex] { constantColor(0,0,0, [_ReflectionAlpha]) matrix [_ProjMatrix] combine texture * previous, constant} &lt;br /&gt;
        }&lt;br /&gt;
        Pass&lt;br /&gt;
        {&lt;br /&gt;
            SetTexture[_MainTex] { constantColor(0,0,0, [_MainAlpha]) combine texture * primary, texture * constant}&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    //Fallback: just main texture&lt;br /&gt;
    Subshader&lt;br /&gt;
    {&lt;br /&gt;
        Pass&lt;br /&gt;
        {&lt;br /&gt;
            SetTexture [_MainTex] { combine texture }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Script - SurfaceReflection.cs==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using UnityEngine;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
 &lt;br /&gt;
//This is in fact just the Water script from Pro Standard Assets,&lt;br /&gt;
//just with refraction stuff removed.&lt;br /&gt;
 &lt;br /&gt;
[ExecuteInEditMode] //Make reflection live-update even when not in play mode&lt;br /&gt;
public class SurfaceReflection : MonoBehaviour&lt;br /&gt;
{&lt;br /&gt;
    public bool m_DisablePixelLights = true;&lt;br /&gt;
    public int m_TextureSize = 256;&lt;br /&gt;
    public float m_clipPlaneOffset = 0.07f;&lt;br /&gt;
    private float m_finalClipPlaneOffset = 0.0f;&lt;br /&gt;
    public bool m_NormalsFromMesh = false;&lt;br /&gt;
    public bool m_BaseClipOffsetFromMesh = false;&lt;br /&gt;
    public bool m_BaseClipOffsetFromMeshInverted = false;&lt;br /&gt;
    private Vector3 m_calculatedNormal = Vector3.zero;&lt;br /&gt;
 &lt;br /&gt;
    public LayerMask m_ReflectLayers = -1;&lt;br /&gt;
 &lt;br /&gt;
    private Hashtable m_ReflectionCameras = new Hashtable(); //Camera -&amp;gt; Camera table&lt;br /&gt;
 &lt;br /&gt;
    private RenderTexture m_ReflectionTexture = null;&lt;br /&gt;
    private int m_OldReflectionTextureSize = 0;&lt;br /&gt;
 &lt;br /&gt;
    private static bool s_InsideRendering = false;&lt;br /&gt;
 &lt;br /&gt;
    //This is called when it's known that the object will be rendered by some&lt;br /&gt;
    //camera. We render reflections and do other updates here.&lt;br /&gt;
    //Because the script executes in edit mode, reflections for the scene view&lt;br /&gt;
    //camera will just work!&lt;br /&gt;
    public void OnWillRenderObject()&lt;br /&gt;
    {&lt;br /&gt;
        if(!enabled || !renderer || !renderer.sharedMaterial || !renderer.enabled)&lt;br /&gt;
            return;&lt;br /&gt;
 &lt;br /&gt;
        Camera cam = Camera.current;&lt;br /&gt;
        if(!cam)&lt;br /&gt;
            return;&lt;br /&gt;
        &lt;br /&gt;
        if(m_NormalsFromMesh &amp;amp;&amp;amp; GetComponent&amp;lt;MeshFilter&amp;gt;() != null)&lt;br /&gt;
             m_calculatedNormal = transform.TransformDirection(GetComponent&amp;lt;MeshFilter&amp;gt;().sharedMesh.normals[0]);&lt;br /&gt;
        &lt;br /&gt;
         if(m_BaseClipOffsetFromMesh &amp;amp;&amp;amp; GetComponent&amp;lt;MeshFilter&amp;gt;() != null)&lt;br /&gt;
            m_finalClipPlaneOffset = (transform.position - transform.TransformPoint(GetComponent&amp;lt;MeshFilter&amp;gt;().sharedMesh.vertices[0])).magnitude + m_clipPlaneOffset;&lt;br /&gt;
        else if(m_BaseClipOffsetFromMeshInverted &amp;amp;&amp;amp; GetComponent&amp;lt;MeshFilter&amp;gt;() != null)&lt;br /&gt;
            m_finalClipPlaneOffset = -(transform.position - transform.TransformPoint(GetComponent&amp;lt;MeshFilter&amp;gt;().sharedMesh.vertices[0])).magnitude + m_clipPlaneOffset;&lt;br /&gt;
        else&lt;br /&gt;
            m_finalClipPlaneOffset = m_clipPlaneOffset;&lt;br /&gt;
            &lt;br /&gt;
        //Safeguard from recursive reflections.        &lt;br /&gt;
        if(s_InsideRendering)&lt;br /&gt;
            return;&lt;br /&gt;
        s_InsideRendering = true;&lt;br /&gt;
 &lt;br /&gt;
        Camera reflectionCamera;&lt;br /&gt;
        CreateSurfaceObjects(cam, out reflectionCamera);&lt;br /&gt;
 &lt;br /&gt;
        //Find out the reflection plane: position and normal in world space&lt;br /&gt;
        Vector3 pos = transform.position;&lt;br /&gt;
        Vector3 normal = m_NormalsFromMesh &amp;amp;&amp;amp; GetComponent&amp;lt;MeshFilter&amp;gt;() != null ? m_calculatedNormal : transform.up;&lt;br /&gt;
 &lt;br /&gt;
        //Optionally disable pixel lights for reflection&lt;br /&gt;
        int oldPixelLightCount = QualitySettings.pixelLightCount;&lt;br /&gt;
        if(m_DisablePixelLights)&lt;br /&gt;
            QualitySettings.pixelLightCount = 0;&lt;br /&gt;
 &lt;br /&gt;
        UpdateCameraModes(cam, reflectionCamera);&lt;br /&gt;
 &lt;br /&gt;
        //Render reflection&lt;br /&gt;
        //Reflect camera around reflection plane&lt;br /&gt;
        float d = -Vector3.Dot (normal, pos) - m_finalClipPlaneOffset;&lt;br /&gt;
        Vector4 reflectionPlane = new Vector4 (normal.x, normal.y, normal.z, d);&lt;br /&gt;
 &lt;br /&gt;
        Matrix4x4 reflection = Matrix4x4.zero;&lt;br /&gt;
        CalculateReflectionMatrix (ref reflection, reflectionPlane);&lt;br /&gt;
        Vector3 oldpos = cam.transform.position;&lt;br /&gt;
        Vector3 newpos = reflection.MultiplyPoint(oldpos);&lt;br /&gt;
        reflectionCamera.worldToCameraMatrix = cam.worldToCameraMatrix * reflection;&lt;br /&gt;
 &lt;br /&gt;
        //Setup oblique projection matrix so that near plane is our reflection plane.&lt;br /&gt;
        //This way we clip everything below/above it for free.&lt;br /&gt;
        Vector4 clipPlane = CameraSpacePlane(reflectionCamera, pos, normal, 1.0f);&lt;br /&gt;
        Matrix4x4 projection = cam.projectionMatrix;&lt;br /&gt;
        CalculateObliqueMatrix (ref projection, clipPlane);&lt;br /&gt;
        reflectionCamera.projectionMatrix = projection;&lt;br /&gt;
 &lt;br /&gt;
        reflectionCamera.cullingMask = ~(1&amp;lt;&amp;lt;4) &amp;amp; m_ReflectLayers.value; //never render water layer&lt;br /&gt;
        reflectionCamera.targetTexture = m_ReflectionTexture;&lt;br /&gt;
        GL.SetRevertBackfacing (true);&lt;br /&gt;
        reflectionCamera.transform.position = newpos;&lt;br /&gt;
        Vector3 euler = cam.transform.eulerAngles;&lt;br /&gt;
        reflectionCamera.transform.eulerAngles = new Vector3(0, euler.y, euler.z);&lt;br /&gt;
        reflectionCamera.Render();&lt;br /&gt;
        reflectionCamera.transform.position = oldpos;&lt;br /&gt;
        GL.SetRevertBackfacing (false);&lt;br /&gt;
        Material[] materials = renderer.sharedMaterials;&lt;br /&gt;
        foreach(Material mat in materials)&lt;br /&gt;
        {&lt;br /&gt;
            if(mat.HasProperty(&amp;quot;_ReflectionTex&amp;quot;))&lt;br /&gt;
                mat.SetTexture(&amp;quot;_ReflectionTex&amp;quot;, m_ReflectionTexture);&lt;br /&gt;
        }&lt;br /&gt;
 &lt;br /&gt;
        //Set matrix on the shader that transforms UVs from object space into screen&lt;br /&gt;
        //space. We want to just project reflection texture on screen.&lt;br /&gt;
        Matrix4x4 scaleOffset = Matrix4x4.TRS(&lt;br /&gt;
            new Vector3(0.5f,0.5f,0.5f), Quaternion.identity, new Vector3(0.5f,0.5f,0.5f));&lt;br /&gt;
        Vector3 scale = transform.lossyScale;&lt;br /&gt;
        Matrix4x4 mtx = transform.localToWorldMatrix * Matrix4x4.Scale(new Vector3(1.0f/scale.x, 1.0f/scale.y, 1.0f/scale.z));&lt;br /&gt;
        mtx = scaleOffset * cam.projectionMatrix * cam.worldToCameraMatrix * mtx;&lt;br /&gt;
        foreach(Material mat in materials)&lt;br /&gt;
            mat.SetMatrix(&amp;quot;_ProjMatrix&amp;quot;, mtx);&lt;br /&gt;
 &lt;br /&gt;
        //Restore pixel light count&lt;br /&gt;
        if(m_DisablePixelLights)&lt;br /&gt;
            QualitySettings.pixelLightCount = oldPixelLightCount;&lt;br /&gt;
 &lt;br /&gt;
        s_InsideRendering = false;&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
    //Cleanup all the objects we possibly have created&lt;br /&gt;
    void OnDisable()&lt;br /&gt;
    {&lt;br /&gt;
        if(m_ReflectionTexture)&lt;br /&gt;
        {&lt;br /&gt;
            DestroyImmediate(m_ReflectionTexture);&lt;br /&gt;
            m_ReflectionTexture = null;&lt;br /&gt;
        }&lt;br /&gt;
        foreach(DictionaryEntry kvp in m_ReflectionCameras)&lt;br /&gt;
            DestroyImmediate(((Camera)kvp.Value).gameObject);&lt;br /&gt;
        m_ReflectionCameras.Clear();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
    private void UpdateCameraModes(Camera src, Camera dest)&lt;br /&gt;
    {&lt;br /&gt;
        if(dest == null)&lt;br /&gt;
            return;&lt;br /&gt;
        //set camera to clear the same way as current camera&lt;br /&gt;
        dest.clearFlags = src.clearFlags;&lt;br /&gt;
        dest.backgroundColor = src.backgroundColor;        &lt;br /&gt;
        if(src.clearFlags == CameraClearFlags.Skybox)&lt;br /&gt;
        {&lt;br /&gt;
            Skybox sky = src.GetComponent(typeof(Skybox)) as Skybox;&lt;br /&gt;
            Skybox mysky = dest.GetComponent(typeof(Skybox)) as Skybox;&lt;br /&gt;
            if(!sky || !sky.material)&lt;br /&gt;
            {&lt;br /&gt;
                mysky.enabled = false;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                mysky.enabled = true;&lt;br /&gt;
                mysky.material = sky.material;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        //update other values to match current camera.&lt;br /&gt;
        //even if we are supplying custom camera&amp;amp;projection matrices,&lt;br /&gt;
        //some of values are used elsewhere (e.g. skybox uses far plane)&lt;br /&gt;
        dest.farClipPlane = src.farClipPlane;&lt;br /&gt;
        dest.nearClipPlane = src.nearClipPlane;&lt;br /&gt;
        dest.orthographic = src.orthographic;&lt;br /&gt;
        dest.fieldOfView = src.fieldOfView;&lt;br /&gt;
        dest.aspect = src.aspect;&lt;br /&gt;
        dest.orthographicSize = src.orthographicSize;&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    //On-demand create any objects we need&lt;br /&gt;
    private void CreateSurfaceObjects(Camera currentCamera, out Camera reflectionCamera)&lt;br /&gt;
    {&lt;br /&gt;
        reflectionCamera = null;&lt;br /&gt;
 &lt;br /&gt;
        //Reflection render texture&lt;br /&gt;
        if(!m_ReflectionTexture || m_OldReflectionTextureSize != m_TextureSize)&lt;br /&gt;
        {&lt;br /&gt;
            if(m_ReflectionTexture)&lt;br /&gt;
                DestroyImmediate(m_ReflectionTexture);&lt;br /&gt;
            m_ReflectionTexture = new RenderTexture(m_TextureSize, m_TextureSize, 16);&lt;br /&gt;
            m_ReflectionTexture.name = &amp;quot;__SurfaceReflection&amp;quot; + GetInstanceID();&lt;br /&gt;
            m_ReflectionTexture.isPowerOfTwo = true;&lt;br /&gt;
            m_ReflectionTexture.hideFlags = HideFlags.DontSave;&lt;br /&gt;
            m_OldReflectionTextureSize = m_TextureSize;&lt;br /&gt;
        }&lt;br /&gt;
 &lt;br /&gt;
        //Camera for reflection&lt;br /&gt;
        reflectionCamera = m_ReflectionCameras[currentCamera] as Camera;&lt;br /&gt;
        if(!reflectionCamera) //catch both not-in-dictionary and in-dictionary-but-deleted-GO&lt;br /&gt;
        {&lt;br /&gt;
            GameObject go = new GameObject(&amp;quot;Surface Refl Camera id&amp;quot; + GetInstanceID() + &amp;quot; for &amp;quot; + currentCamera.GetInstanceID(), typeof(Camera), typeof(Skybox));&lt;br /&gt;
            reflectionCamera = go.camera;&lt;br /&gt;
            reflectionCamera.enabled = false;&lt;br /&gt;
            reflectionCamera.transform.position = transform.position;&lt;br /&gt;
            reflectionCamera.transform.rotation = transform.rotation;&lt;br /&gt;
            reflectionCamera.gameObject.AddComponent(&amp;quot;FlareLayer&amp;quot;);&lt;br /&gt;
            go.hideFlags = HideFlags.HideAndDontSave;&lt;br /&gt;
            m_ReflectionCameras[currentCamera] = reflectionCamera;&lt;br /&gt;
        }        &lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    //Extended sign: returns -1, 0 or 1 based on sign of a&lt;br /&gt;
    private static float sgn(float a)&lt;br /&gt;
    {&lt;br /&gt;
        if (a &amp;gt; 0.0f) return 1.0f;&lt;br /&gt;
        if (a &amp;lt; 0.0f) return -1.0f;&lt;br /&gt;
        return 0.0f;&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    //Given position/normal of the plane, calculates plane in camera space.&lt;br /&gt;
    private Vector4 CameraSpacePlane (Camera cam, Vector3 pos, Vector3 normal, float sideSign)&lt;br /&gt;
    {&lt;br /&gt;
        Vector3 offsetPos = pos + normal * m_finalClipPlaneOffset;&lt;br /&gt;
        Matrix4x4 m = cam.worldToCameraMatrix;&lt;br /&gt;
        Vector3 cpos = m.MultiplyPoint(offsetPos);&lt;br /&gt;
        Vector3 cnormal = m.MultiplyVector(normal).normalized * sideSign;&lt;br /&gt;
        return new Vector4(cnormal.x, cnormal.y, cnormal.z, -Vector3.Dot(cpos,cnormal));&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    //Adjusts the given projection matrix so that near plane is the given clipPlane&lt;br /&gt;
    //clipPlane is given in camera space. See article in Game Programming Gems 5 and&lt;br /&gt;
    //http://aras-p.info/texts/obliqueortho.html&lt;br /&gt;
    private static void CalculateObliqueMatrix (ref Matrix4x4 projection, Vector4 clipPlane)&lt;br /&gt;
    {&lt;br /&gt;
        Vector4 q = projection.inverse * new Vector4(&lt;br /&gt;
            sgn(clipPlane.x),&lt;br /&gt;
            sgn(clipPlane.y),&lt;br /&gt;
            1.0f,&lt;br /&gt;
            1.0f&lt;br /&gt;
       );&lt;br /&gt;
        Vector4 c = clipPlane * (2.0F / (Vector4.Dot (clipPlane, q)));&lt;br /&gt;
        //third row = clip plane - fourth row&lt;br /&gt;
        projection[2] = c.x - projection[3];&lt;br /&gt;
        projection[6] = c.y - projection[7];&lt;br /&gt;
        projection[10] = c.z - projection[11];&lt;br /&gt;
        projection[14] = c.w - projection[15];&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    //Calculates reflection matrix around the given plane&lt;br /&gt;
    private static void CalculateReflectionMatrix (ref Matrix4x4 reflectionMat, Vector4 plane)&lt;br /&gt;
    {&lt;br /&gt;
        reflectionMat.m00 = (1F - 2F*plane[0]*plane[0]);&lt;br /&gt;
        reflectionMat.m01 = (  - 2F*plane[0]*plane[1]);&lt;br /&gt;
        reflectionMat.m02 = (  - 2F*plane[0]*plane[2]);&lt;br /&gt;
        reflectionMat.m03 = (  - 2F*plane[3]*plane[0]);&lt;br /&gt;
 &lt;br /&gt;
        reflectionMat.m10 = (  - 2F*plane[1]*plane[0]);&lt;br /&gt;
        reflectionMat.m11 = (1F - 2F*plane[1]*plane[1]);&lt;br /&gt;
        reflectionMat.m12 = (  - 2F*plane[1]*plane[2]);&lt;br /&gt;
        reflectionMat.m13 = (  - 2F*plane[3]*plane[1]);&lt;br /&gt;
 &lt;br /&gt;
        reflectionMat.m20 = (  - 2F*plane[2]*plane[0]);&lt;br /&gt;
        reflectionMat.m21 = (  - 2F*plane[2]*plane[1]);&lt;br /&gt;
        reflectionMat.m22 = (1F - 2F*plane[2]*plane[2]);&lt;br /&gt;
        reflectionMat.m23 = (  - 2F*plane[3]*plane[2]);&lt;br /&gt;
 &lt;br /&gt;
        reflectionMat.m30 = 0F;&lt;br /&gt;
        reflectionMat.m31 = 0F;&lt;br /&gt;
        reflectionMat.m32 = 0F;&lt;br /&gt;
        reflectionMat.m33 = 1F;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Venryx</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/Extension/Methods</id>
		<title>Extension/Methods</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/Extension/Methods"/>
				<updated>2013-02-28T12:54:02Z</updated>
		
		<summary type="html">&lt;p&gt;Createdbyx: Created page as part of the Extensions page retro fit. See discussion page at http://wiki.unity3d.com/index.php/Extensions for details&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;width:100%; margin:auto; background:transparent;&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; valign=&amp;quot;top&amp;quot; border=&amp;quot;0&amp;quot; |	&lt;br /&gt;
| style=&amp;quot;padding:0 .3em; background-color:#CEE0F2; font-size:90%; border:solid 2px #A3B1BF; text-align:center&amp;quot; width=&amp;quot;8%&amp;quot; | {{{1|[[Extensions| Plugins]]}}}&lt;br /&gt;
	&lt;br /&gt;
| style=&amp;quot;border-bottom:2px solid #A3B1BF&amp;quot; width=&amp;quot;1%&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;padding:0.3em; font-size:90%; background-color:#CEE0F2; border:solid 2px #A3B1BF; text-align:center&amp;quot; width=&amp;quot;8%&amp;quot; | {{{2|[[Extension/Methods| Extension Methods]]}}}&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border-bottom:2px solid #A3B1BF&amp;quot; width=&amp;quot;1%&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;padding:0.3em; font-size:90%; background-color:#CEE0F2; border:solid 2px #A3B1BF; text-align:center&amp;quot; width=&amp;quot;8%&amp;quot; | {{{2|[[Extensions/Packages| Packages]]}}}&lt;br /&gt;
	 	&lt;br /&gt;
|-&lt;br /&gt;
{|cellspacing=&amp;quot;10px&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;background:white; border-left:2px solid #A3B1BF; border-right:2px solid #A3B1BF&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;| &lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;right&amp;quot;&lt;br /&gt;
  | __TOC__&lt;br /&gt;
  |}&lt;br /&gt;
 &lt;br /&gt;
Extension methods extend existing functionality to existing types.  &lt;br /&gt;
&lt;br /&gt;
== C# == &lt;br /&gt;
*[[EnumExtensions]] - This script provides an instance TryParse method for .Net's System.Enum class.&lt;br /&gt;
*[[GetOrAddComponent]] - Simple method extension to save 2 or 3 lines of very redundant and ugly code. It will check if component exists before adding new one. &lt;br /&gt;
*[[IsVisibleFrom]] - This C# class gives simple extension access to checking if an Renderer is rendered by a specific Camera. &lt;br /&gt;
*[[LayerMaskExtensions]] - This C# class gives simple extension access to manipulating and debugging LayerMasks. &lt;br /&gt;
*[[QuaternionExtensions]] - This script provide a few useful extensions to the inbuilt 'Quaternion' struct. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;div style=&amp;quot;border:2px solid #A3B1BF;padding:.5em 1em 1em 1em; border-top:none; border-bottom:2px solid #A3B1BF;  border-right:2px solid #A3B1BF; background-color:#ffffff; color:#000;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:.NET Plugins]]&lt;br /&gt;
[[Category:Native Code Plugins]]&lt;/div&gt;</summary>
		<author><name>Createdbyx</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/Extensions/Packages</id>
		<title>Extensions/Packages</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/Extensions/Packages"/>
				<updated>2013-02-28T12:52:58Z</updated>
		
		<summary type="html">&lt;p&gt;Createdbyx: Created page as part of the Extensions page retro fit. See discussion page at http://wiki.unity3d.com/index.php/Extensions for details&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;width:100%; margin:auto; background:transparent;&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; valign=&amp;quot;top&amp;quot; border=&amp;quot;0&amp;quot; |	&lt;br /&gt;
| style=&amp;quot;padding:0 .3em; background-color:#CEE0F2; font-size:90%; border:solid 2px #A3B1BF; text-align:center&amp;quot; width=&amp;quot;8%&amp;quot; | {{{1|[[Extensions| Plugins]]}}}&lt;br /&gt;
	&lt;br /&gt;
| style=&amp;quot;border-bottom:2px solid #A3B1BF&amp;quot; width=&amp;quot;1%&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;padding:0.3em; font-size:90%; background-color:#CEE0F2; border:solid 2px #A3B1BF; text-align:center&amp;quot; width=&amp;quot;8%&amp;quot; | {{{2|[[Extension/Methods| Extension Methods]]}}}&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border-bottom:2px solid #A3B1BF&amp;quot; width=&amp;quot;1%&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;padding:0.3em; font-size:90%; background-color:#CEE0F2; border:solid 2px #A3B1BF; text-align:center&amp;quot; width=&amp;quot;8%&amp;quot; | {{{2|[[Extensions/Packages| Packages]]}}}&lt;br /&gt;
	 	&lt;br /&gt;
|-&lt;br /&gt;
{|cellspacing=&amp;quot;10px&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;background:white; border-left:2px solid #A3B1BF; border-right:2px solid #A3B1BF&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
 &lt;br /&gt;
{| align=&amp;quot;right&amp;quot;&lt;br /&gt;
  | __TOC__&lt;br /&gt;
  |}&lt;br /&gt;
 &lt;br /&gt;
This page intends to provide links to *.unitypackage downloads from across the web that are not currently available in the [[https://www.assetstore.unity3d.com/ unity asset store]]. When adding links to this page please be sure to organize them under a category that you think you would find it if it was available in the unity asset store. For example if the package contains game scripts include it under a &amp;quot;Scripts&amp;quot; section, if the package contains functionality that extends the unity editor include it under the &amp;quot;Editor Extensions&amp;quot; category etc.&lt;br /&gt;
&lt;br /&gt;
== Editor Extensions ==&lt;br /&gt;
[[http://www.codefarts.com/CBXGeneralTools/ CBX.GeneralTools]] - Provides a number of general purpose tools that assist you in performing general tasks within Unity that you would otherwise not be able to do with just the Unity editor tools alone.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;div style=&amp;quot;border:2px solid #A3B1BF;padding:.5em 1em 1em 1em; border-top:none; border-bottom:2px solid #A3B1BF;  border-right:2px solid #A3B1BF; background-color:#ffffff; color:#000;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Createdbyx</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/Glass_Shader</id>
		<title>Glass Shader</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/Glass_Shader"/>
				<updated>2013-02-26T16:58:42Z</updated>
		
		<summary type="html">&lt;p&gt;Danielbrauer: Initial version with basic and reflective shaders&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Unity 3.x shaders]]&lt;br /&gt;
[[Category: Cg shaders]]&lt;br /&gt;
&lt;br /&gt;
Author: [[User:Danielbrauer|Daniel Brauer]]&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
All of Unity's built-in transparent shaders attenuate specular contribution with transparency. This is great for things with holes in them, but terrible for windows that you want to reflect light. The following shaders are always 100% transparent, but always show specular (and optionally reflective) contribution.&lt;br /&gt;
&lt;br /&gt;
==ShaderLab - Glass.shader==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shaderlab&amp;quot;&amp;gt;&lt;br /&gt;
Shader &amp;quot;Glass&amp;quot; {&lt;br /&gt;
	Properties {&lt;br /&gt;
		_SpecColor (&amp;quot;Specular Color&amp;quot;, Color) = (0.5, 0.5, 0.5, 1)&lt;br /&gt;
		_Shininess (&amp;quot;Shininess&amp;quot;, Range (0.01, 1)) = 0.078125&lt;br /&gt;
	}&lt;br /&gt;
	SubShader {&lt;br /&gt;
		Tags {&lt;br /&gt;
			&amp;quot;Queue&amp;quot;=&amp;quot;Transparent&amp;quot;&lt;br /&gt;
			&amp;quot;IgnoreProjector&amp;quot;=&amp;quot;True&amp;quot;&lt;br /&gt;
			&amp;quot;RenderType&amp;quot;=&amp;quot;Transparent&amp;quot;&lt;br /&gt;
		}&lt;br /&gt;
		LOD 300&lt;br /&gt;
		&lt;br /&gt;
		CGPROGRAM&lt;br /&gt;
			#pragma surface surf BlinnPhong decal:add nolightmap&lt;br /&gt;
			&lt;br /&gt;
			half _Shininess;&lt;br /&gt;
			&lt;br /&gt;
			struct Input {&lt;br /&gt;
				float dummy;&lt;br /&gt;
			};&lt;br /&gt;
			&lt;br /&gt;
			void surf (Input IN, inout SurfaceOutput o) {&lt;br /&gt;
				o.Albedo = 0;&lt;br /&gt;
				o.Gloss = 1;&lt;br /&gt;
				o.Specular = _Shininess;&lt;br /&gt;
				o.Alpha = 0;&lt;br /&gt;
			}&lt;br /&gt;
		ENDCG&lt;br /&gt;
	}&lt;br /&gt;
	FallBack &amp;quot;Transparent/VertexLit&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ShaderLab - Glass Reflective.shader==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shaderlab&amp;quot;&amp;gt;&lt;br /&gt;
Shader &amp;quot;Glass Reflective&amp;quot; {&lt;br /&gt;
	Properties {&lt;br /&gt;
		_SpecColor (&amp;quot;Specular Color&amp;quot;, Color) = (0.5, 0.5, 0.5, 1)&lt;br /&gt;
		_Shininess (&amp;quot;Shininess&amp;quot;, Range (0.01, 1)) = 0.078125&lt;br /&gt;
		_ReflectColor (&amp;quot;Reflection Color&amp;quot;, Color) = (1,1,1,0.5)&lt;br /&gt;
		_Cube (&amp;quot;Reflection Cubemap&amp;quot;, Cube) = &amp;quot;black&amp;quot; { TexGen CubeReflect }&lt;br /&gt;
	}&lt;br /&gt;
	SubShader {&lt;br /&gt;
		Tags {&lt;br /&gt;
			&amp;quot;Queue&amp;quot;=&amp;quot;Transparent&amp;quot;&lt;br /&gt;
			&amp;quot;IgnoreProjector&amp;quot;=&amp;quot;True&amp;quot;&lt;br /&gt;
			&amp;quot;RenderType&amp;quot;=&amp;quot;Transparent&amp;quot;&lt;br /&gt;
		}&lt;br /&gt;
		LOD 300&lt;br /&gt;
		&lt;br /&gt;
		CGPROGRAM&lt;br /&gt;
			#pragma surface surf BlinnPhong decal:add nolightmap&lt;br /&gt;
			&lt;br /&gt;
			samplerCUBE _Cube;&lt;br /&gt;
			&lt;br /&gt;
			fixed4 _ReflectColor;&lt;br /&gt;
			half _Shininess;&lt;br /&gt;
			&lt;br /&gt;
			struct Input {&lt;br /&gt;
				float3 worldRefl;&lt;br /&gt;
			};&lt;br /&gt;
			&lt;br /&gt;
			void surf (Input IN, inout SurfaceOutput o) {&lt;br /&gt;
				o.Albedo = 0;&lt;br /&gt;
				o.Gloss = 1;&lt;br /&gt;
				o.Specular = _Shininess;&lt;br /&gt;
				&lt;br /&gt;
				fixed4 reflcol = texCUBE (_Cube, IN.worldRefl);&lt;br /&gt;
				o.Emission = reflcol.rgb * _ReflectColor.rgb;&lt;br /&gt;
				o.Alpha = reflcol.a * _ReflectColor.a;&lt;br /&gt;
			}&lt;br /&gt;
		ENDCG&lt;br /&gt;
	}&lt;br /&gt;
	FallBack &amp;quot;Transparent/VertexLit&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Danielbrauer</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/FootstepHandler</id>
		<title>FootstepHandler</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/FootstepHandler"/>
				<updated>2013-02-19T16:58:26Z</updated>
		
		<summary type="html">&lt;p&gt;BakuJake14: Created page with &amp;quot;Category:CSharp Category:MonoBehaviour Author: Jake Bayer (BakuJake14)  ==Description== Simple C# script using CharacterController to create footstep sounds.  ==Usage=...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:CSharp]]&lt;br /&gt;
[[Category:MonoBehaviour]]&lt;br /&gt;
Author: Jake Bayer (BakuJake14)&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Simple C# script using CharacterController to create footstep sounds.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
Use the '''sounds''' variable to assign the audio clip you want to use.  It is recommended to use one audio clip only.  Use '''minInterval''', '''maxVelocity''', and '''bias''' to change how the audio works.&lt;br /&gt;
&lt;br /&gt;
==FootstepHandler.cs==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
&lt;br /&gt;
[RequireComponent(typeof(AudioSource))]&lt;br /&gt;
[RequireComponent(typeof(CharacterController))]&lt;br /&gt;
public class FootstepHandler : MonoBehaviour {&lt;br /&gt;
	public AudioClip[] sounds;			//An array that stores the footstep sounds&lt;br /&gt;
	public float minInterval = 0.1f;&lt;br /&gt;
	public float maxVelocity = 8.0f;&lt;br /&gt;
	public float bias = 1.1f;&lt;br /&gt;
	&lt;br /&gt;
	private CharacterController _controller;&lt;br /&gt;
	&lt;br /&gt;
	void Awake() {&lt;br /&gt;
		_controller = GetComponent&amp;lt;CharacterController&amp;gt;();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	// Use this for initialization&lt;br /&gt;
	IEnumerator Start () {&lt;br /&gt;
		while(true) {&lt;br /&gt;
			float vel = _controller.velocity.magnitude;&lt;br /&gt;
			if(_controller.isGrounded &amp;amp;&amp;amp; vel &amp;gt; 0.2f) {&lt;br /&gt;
				audio.clip = sounds[Random.Range(0, sounds.Length)];&lt;br /&gt;
				audio.Play();&lt;br /&gt;
				float interval = minInterval * (maxVelocity + bias) / (vel + bias);&lt;br /&gt;
				yield return new WaitForSeconds(interval);&lt;br /&gt;
			}&lt;br /&gt;
			else {&lt;br /&gt;
				yield return 0;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
	&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>BakuJake14</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/Transparent_Diffuse_Two_Pass_Lit_Shadows</id>
		<title>Transparent Diffuse Two Pass Lit Shadows</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/Transparent_Diffuse_Two_Pass_Lit_Shadows"/>
				<updated>2013-02-15T16:46:24Z</updated>
		
		<summary type="html">&lt;p&gt;Horsman: /* Shader Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Description==&lt;br /&gt;
[[File:TwoPassLit.png]]&lt;br /&gt;
&lt;br /&gt;
two pass transparent shader with soft edges and no sorting required.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
The &amp;quot;_Cutoff&amp;quot; variable specifies the base alpha cutoff.&lt;br /&gt;
&lt;br /&gt;
Works with lights in forward and deffered mode and with shadows / point / directional.&lt;br /&gt;
&lt;br /&gt;
==More==&lt;br /&gt;
&lt;br /&gt;
[[Category: Unity 3.x shaders]]&lt;br /&gt;
[[Category: Cg shaders]]&lt;br /&gt;
[[Category: Transparent]]&lt;br /&gt;
[[Category: Blending]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shader Files==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shader &amp;quot;Transparent/Cutout/Soft Edge Lit Double Sided&amp;quot; {&lt;br /&gt;
Properties {&lt;br /&gt;
	_Color (&amp;quot;Main Color&amp;quot;, Color) = (1,1,1,1)&lt;br /&gt;
	_MainTex (&amp;quot;Base (RGB) Trans (A)&amp;quot;, 2D) = &amp;quot;white&amp;quot; {}&lt;br /&gt;
	_Cutoff (&amp;quot;Alpha cutoff&amp;quot;, Range(0,1)) = 0.5&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
SubShader {&lt;br /&gt;
	Tags {&amp;quot;Queue&amp;quot;=&amp;quot;AlphaTest&amp;quot; &amp;quot;IgnoreProjector&amp;quot;=&amp;quot;True&amp;quot; &amp;quot;RenderType&amp;quot;=&amp;quot;TransparentCutout&amp;quot;}&lt;br /&gt;
	LOD 200&lt;br /&gt;
	Cull Off&lt;br /&gt;
	&lt;br /&gt;
	//   render the semitransparent details.&lt;br /&gt;
	Pass {&lt;br /&gt;
		&lt;br /&gt;
		// Dont write to the depth buffer&lt;br /&gt;
		&lt;br /&gt;
		Name &amp;quot;FORWARD&amp;quot;&lt;br /&gt;
		Tags { &amp;quot;LightMode&amp;quot; = &amp;quot;ForwardBase&amp;quot; }&lt;br /&gt;
		Blend SrcAlpha OneMinusSrcAlpha&lt;br /&gt;
		ZWrite off&lt;br /&gt;
&lt;br /&gt;
CGPROGRAM&lt;br /&gt;
#pragma vertex vert_surf&lt;br /&gt;
#pragma fragment frag_surf&lt;br /&gt;
#pragma fragmentoption ARB_precision_hint_fastest&lt;br /&gt;
#pragma multi_compile_fwdbasealpha&lt;br /&gt;
#include &amp;quot;HLSLSupport.cginc&amp;quot;&lt;br /&gt;
#include &amp;quot;UnityShaderVariables.cginc&amp;quot;&lt;br /&gt;
#define UNITY_PASS_FORWARDBASE&lt;br /&gt;
#include &amp;quot;UnityCG.cginc&amp;quot;&lt;br /&gt;
#include &amp;quot;Lighting.cginc&amp;quot;&lt;br /&gt;
#include &amp;quot;AutoLight.cginc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define INTERNAL_DATA&lt;br /&gt;
#define WorldReflectionVector(data,normal) data.worldRefl&lt;br /&gt;
#define WorldNormalVector(data,normal) normal&lt;br /&gt;
#line 1&lt;br /&gt;
#line 12&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sampler2D _MainTex;&lt;br /&gt;
fixed4 _Color;&lt;br /&gt;
&lt;br /&gt;
struct Input {&lt;br /&gt;
	float2 uv_MainTex;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void surf (Input IN, inout SurfaceOutput o) {&lt;br /&gt;
	fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;&lt;br /&gt;
	o.Albedo = c.rgb;&lt;br /&gt;
	o.Alpha = c.a;&lt;br /&gt;
}&lt;br /&gt;
#ifdef LIGHTMAP_OFF&lt;br /&gt;
struct v2f_surf {&lt;br /&gt;
  float4 pos : SV_POSITION;&lt;br /&gt;
  float2 pack0 : TEXCOORD0;&lt;br /&gt;
  fixed3 normal : TEXCOORD1;&lt;br /&gt;
  fixed3 vlight : TEXCOORD2;&lt;br /&gt;
  LIGHTING_COORDS(3,4)&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
#ifndef LIGHTMAP_OFF&lt;br /&gt;
struct v2f_surf {&lt;br /&gt;
  float4 pos : SV_POSITION;&lt;br /&gt;
  float2 pack0 : TEXCOORD0;&lt;br /&gt;
  float2 lmap : TEXCOORD1;&lt;br /&gt;
  LIGHTING_COORDS(2,3)&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
#ifndef LIGHTMAP_OFF&lt;br /&gt;
float4 unity_LightmapST;&lt;br /&gt;
#endif&lt;br /&gt;
float4 _MainTex_ST;&lt;br /&gt;
v2f_surf vert_surf (appdata_full v) {&lt;br /&gt;
  v2f_surf o;&lt;br /&gt;
  o.pos = mul (UNITY_MATRIX_MVP, v.vertex);&lt;br /&gt;
  o.pack0.xy = TRANSFORM_TEX(v.texcoord, _MainTex);&lt;br /&gt;
  #ifndef LIGHTMAP_OFF&lt;br /&gt;
  o.lmap.xy = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw;&lt;br /&gt;
  #endif&lt;br /&gt;
  float3 worldN = mul((float3x3)_Object2World, SCALED_NORMAL);&lt;br /&gt;
  #ifdef LIGHTMAP_OFF&lt;br /&gt;
  o.normal = worldN;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifdef LIGHTMAP_OFF&lt;br /&gt;
  float3 shlight = ShadeSH9 (float4(worldN,1.0));&lt;br /&gt;
  o.vlight = shlight;&lt;br /&gt;
  #ifdef VERTEXLIGHT_ON&lt;br /&gt;
  float3 worldPos = mul(_Object2World, v.vertex).xyz;&lt;br /&gt;
  o.vlight += Shade4PointLights (&lt;br /&gt;
    unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0,&lt;br /&gt;
    unity_LightColor[0].rgb, unity_LightColor[1].rgb, unity_LightColor[2].rgb, unity_LightColor[3].rgb,&lt;br /&gt;
    unity_4LightAtten0, worldPos, worldN );&lt;br /&gt;
  #endif // VERTEXLIGHT_ON&lt;br /&gt;
  #endif // LIGHTMAP_OFF&lt;br /&gt;
  TRANSFER_VERTEX_TO_FRAGMENT(o);&lt;br /&gt;
  return o;&lt;br /&gt;
}&lt;br /&gt;
#ifndef LIGHTMAP_OFF&lt;br /&gt;
sampler2D unity_Lightmap;&lt;br /&gt;
#ifndef DIRLIGHTMAP_OFF&lt;br /&gt;
sampler2D unity_LightmapInd;&lt;br /&gt;
#endif&lt;br /&gt;
#endif&lt;br /&gt;
fixed4 frag_surf (v2f_surf IN) : COLOR {&lt;br /&gt;
  Input surfIN;&lt;br /&gt;
  surfIN.uv_MainTex = IN.pack0.xy;&lt;br /&gt;
  #ifdef UNITY_COMPILER_HLSL&lt;br /&gt;
  SurfaceOutput o = (SurfaceOutput)0;&lt;br /&gt;
  #else&lt;br /&gt;
  SurfaceOutput o;&lt;br /&gt;
  #endif&lt;br /&gt;
  o.Albedo = 0.0;&lt;br /&gt;
  o.Emission = 0.0;&lt;br /&gt;
  o.Specular = 0.0;&lt;br /&gt;
  o.Alpha = 0.0;&lt;br /&gt;
  o.Gloss = 0.0;&lt;br /&gt;
  #ifdef LIGHTMAP_OFF&lt;br /&gt;
  o.Normal = IN.normal;&lt;br /&gt;
  #endif&lt;br /&gt;
  surf (surfIN, o);&lt;br /&gt;
  fixed atten = LIGHT_ATTENUATION(IN);&lt;br /&gt;
  fixed4 c = 0;&lt;br /&gt;
  #ifdef LIGHTMAP_OFF&lt;br /&gt;
  c = LightingLambert (o, _WorldSpaceLightPos0.xyz, atten);&lt;br /&gt;
  #endif // LIGHTMAP_OFF&lt;br /&gt;
  #ifdef LIGHTMAP_OFF&lt;br /&gt;
  c.rgb += o.Albedo * IN.vlight;&lt;br /&gt;
  #endif // LIGHTMAP_OFF&lt;br /&gt;
  #ifndef LIGHTMAP_OFF&lt;br /&gt;
  #ifdef DIRLIGHTMAP_OFF&lt;br /&gt;
  fixed4 lmtex = tex2D(unity_Lightmap, IN.lmap.xy);&lt;br /&gt;
  fixed3 lm = DecodeLightmap (lmtex);&lt;br /&gt;
  #else&lt;br /&gt;
  fixed4 lmtex = tex2D(unity_Lightmap, IN.lmap.xy);&lt;br /&gt;
  fixed4 lmIndTex = tex2D(unity_LightmapInd, IN.lmap.xy);&lt;br /&gt;
  half3 lm = LightingLambert_DirLightmap(o, lmtex, lmIndTex, 0).rgb;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifdef SHADOWS_SCREEN&lt;br /&gt;
  #if defined(SHADER_API_GLES) &amp;amp;&amp;amp; defined(SHADER_API_MOBILE)&lt;br /&gt;
  c.rgb += o.Albedo * min(lm, atten*2);&lt;br /&gt;
  #else&lt;br /&gt;
  c.rgb += o.Albedo * max(min(lm,(atten*2)*lmtex.rgb), lm*atten);&lt;br /&gt;
  #endif&lt;br /&gt;
  #else // SHADOWS_SCREEN&lt;br /&gt;
  c.rgb += o.Albedo * lm;&lt;br /&gt;
  #endif // SHADOWS_SCREEN&lt;br /&gt;
  c.a = o.Alpha;&lt;br /&gt;
#endif // LIGHTMAP_OFF&lt;br /&gt;
  c.a = o.Alpha;&lt;br /&gt;
  return c;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
ENDCG&lt;br /&gt;
	} &lt;br /&gt;
	Pass {&lt;br /&gt;
		Name &amp;quot;FORWARD&amp;quot;&lt;br /&gt;
		Tags { &amp;quot;LightMode&amp;quot; = &amp;quot;ForwardBase&amp;quot; }&lt;br /&gt;
		ColorMask RGB&lt;br /&gt;
CGPROGRAM&lt;br /&gt;
#pragma vertex vert_surf&lt;br /&gt;
#pragma fragment frag_surf&lt;br /&gt;
#pragma fragmentoption ARB_precision_hint_fastest&lt;br /&gt;
#pragma multi_compile_fwdbase&lt;br /&gt;
#include &amp;quot;HLSLSupport.cginc&amp;quot;&lt;br /&gt;
#include &amp;quot;UnityShaderVariables.cginc&amp;quot;&lt;br /&gt;
#define UNITY_PASS_FORWARDBASE&lt;br /&gt;
#include &amp;quot;UnityCG.cginc&amp;quot;&lt;br /&gt;
#include &amp;quot;Lighting.cginc&amp;quot;&lt;br /&gt;
#include &amp;quot;AutoLight.cginc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define INTERNAL_DATA&lt;br /&gt;
#define WorldReflectionVector(data,normal) data.worldRefl&lt;br /&gt;
#define WorldNormalVector(data,normal) normal&lt;br /&gt;
#line 1&lt;br /&gt;
#line 65&lt;br /&gt;
&lt;br /&gt;
sampler2D _MainTex;&lt;br /&gt;
fixed4 _Color;&lt;br /&gt;
&lt;br /&gt;
struct Input {&lt;br /&gt;
	float2 uv_MainTex;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void surf (Input IN, inout SurfaceOutput o) {&lt;br /&gt;
	fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;&lt;br /&gt;
	o.Albedo = c.rgb;&lt;br /&gt;
	o.Alpha = c.a;&lt;br /&gt;
}&lt;br /&gt;
#ifdef LIGHTMAP_OFF&lt;br /&gt;
struct v2f_surf {&lt;br /&gt;
  float4 pos : SV_POSITION;&lt;br /&gt;
  float2 pack0 : TEXCOORD0;&lt;br /&gt;
  fixed3 normal : TEXCOORD1;&lt;br /&gt;
  fixed3 vlight : TEXCOORD2;&lt;br /&gt;
  LIGHTING_COORDS(3,4)&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
#ifndef LIGHTMAP_OFF&lt;br /&gt;
struct v2f_surf {&lt;br /&gt;
  float4 pos : SV_POSITION;&lt;br /&gt;
  float2 pack0 : TEXCOORD0;&lt;br /&gt;
  float2 lmap : TEXCOORD1;&lt;br /&gt;
  LIGHTING_COORDS(2,3)&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
#ifndef LIGHTMAP_OFF&lt;br /&gt;
float4 unity_LightmapST;&lt;br /&gt;
#endif&lt;br /&gt;
float4 _MainTex_ST;&lt;br /&gt;
v2f_surf vert_surf (appdata_full v) {&lt;br /&gt;
  v2f_surf o;&lt;br /&gt;
  o.pos = mul (UNITY_MATRIX_MVP, v.vertex);&lt;br /&gt;
  o.pack0.xy = TRANSFORM_TEX(v.texcoord, _MainTex);&lt;br /&gt;
  #ifndef LIGHTMAP_OFF&lt;br /&gt;
  o.lmap.xy = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw;&lt;br /&gt;
  #endif&lt;br /&gt;
  float3 worldN = mul((float3x3)_Object2World, SCALED_NORMAL);&lt;br /&gt;
  #ifdef LIGHTMAP_OFF&lt;br /&gt;
  o.normal = worldN;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifdef LIGHTMAP_OFF&lt;br /&gt;
  float3 shlight = ShadeSH9 (float4(worldN,1.0));&lt;br /&gt;
  o.vlight = shlight;&lt;br /&gt;
  #ifdef VERTEXLIGHT_ON&lt;br /&gt;
  float3 worldPos = mul(_Object2World, v.vertex).xyz;&lt;br /&gt;
  o.vlight += Shade4PointLights (&lt;br /&gt;
    unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0,&lt;br /&gt;
    unity_LightColor[0].rgb, unity_LightColor[1].rgb, unity_LightColor[2].rgb, unity_LightColor[3].rgb,&lt;br /&gt;
    unity_4LightAtten0, worldPos, worldN );&lt;br /&gt;
  #endif // VERTEXLIGHT_ON&lt;br /&gt;
  #endif // LIGHTMAP_OFF&lt;br /&gt;
  TRANSFER_VERTEX_TO_FRAGMENT(o);&lt;br /&gt;
  return o;&lt;br /&gt;
}&lt;br /&gt;
#ifndef LIGHTMAP_OFF&lt;br /&gt;
sampler2D unity_Lightmap;&lt;br /&gt;
#ifndef DIRLIGHTMAP_OFF&lt;br /&gt;
sampler2D unity_LightmapInd;&lt;br /&gt;
#endif&lt;br /&gt;
#endif&lt;br /&gt;
fixed _Cutoff;&lt;br /&gt;
fixed4 frag_surf (v2f_surf IN) : COLOR {&lt;br /&gt;
  Input surfIN;&lt;br /&gt;
  surfIN.uv_MainTex = IN.pack0.xy;&lt;br /&gt;
  #ifdef UNITY_COMPILER_HLSL&lt;br /&gt;
  SurfaceOutput o = (SurfaceOutput)0;&lt;br /&gt;
  #else&lt;br /&gt;
  SurfaceOutput o;&lt;br /&gt;
  #endif&lt;br /&gt;
  o.Albedo = 0.0;&lt;br /&gt;
  o.Emission = 0.0;&lt;br /&gt;
  o.Specular = 0.0;&lt;br /&gt;
  o.Alpha = 0.0;&lt;br /&gt;
  o.Gloss = 0.0;&lt;br /&gt;
  #ifdef LIGHTMAP_OFF&lt;br /&gt;
  o.Normal = IN.normal;&lt;br /&gt;
  #endif&lt;br /&gt;
  surf (surfIN, o);&lt;br /&gt;
  clip (o.Alpha - _Cutoff);&lt;br /&gt;
  fixed atten = LIGHT_ATTENUATION(IN);&lt;br /&gt;
  fixed4 c = 0;&lt;br /&gt;
  #ifdef LIGHTMAP_OFF&lt;br /&gt;
  c = LightingLambert (o, _WorldSpaceLightPos0.xyz, atten);&lt;br /&gt;
  #endif // LIGHTMAP_OFF&lt;br /&gt;
  #ifdef LIGHTMAP_OFF&lt;br /&gt;
  c.rgb += o.Albedo * IN.vlight;&lt;br /&gt;
  #endif // LIGHTMAP_OFF&lt;br /&gt;
  #ifndef LIGHTMAP_OFF&lt;br /&gt;
  #ifdef DIRLIGHTMAP_OFF&lt;br /&gt;
  fixed4 lmtex = tex2D(unity_Lightmap, IN.lmap.xy);&lt;br /&gt;
  fixed3 lm = DecodeLightmap (lmtex);&lt;br /&gt;
  #else&lt;br /&gt;
  fixed4 lmtex = tex2D(unity_Lightmap, IN.lmap.xy);&lt;br /&gt;
  fixed4 lmIndTex = tex2D(unity_LightmapInd, IN.lmap.xy);&lt;br /&gt;
  half3 lm = LightingLambert_DirLightmap(o, lmtex, lmIndTex, 0).rgb;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifdef SHADOWS_SCREEN&lt;br /&gt;
  #if defined(SHADER_API_GLES) &amp;amp;&amp;amp; defined(SHADER_API_MOBILE)&lt;br /&gt;
  c.rgb += o.Albedo * min(lm, atten*2);&lt;br /&gt;
  #else&lt;br /&gt;
  c.rgb += o.Albedo * max(min(lm,(atten*2)*lmtex.rgb), lm*atten);&lt;br /&gt;
  #endif&lt;br /&gt;
  #else // SHADOWS_SCREEN&lt;br /&gt;
  c.rgb += o.Albedo * lm;&lt;br /&gt;
  #endif // SHADOWS_SCREEN&lt;br /&gt;
  c.a = o.Alpha;&lt;br /&gt;
#endif // LIGHTMAP_OFF&lt;br /&gt;
  c.a = o.Alpha;&lt;br /&gt;
  return c;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
ENDCG &lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
Fallback &amp;quot;Transparent/Cutout/VertexLit&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Horsman</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/ScaleTransform</id>
		<title>ScaleTransform</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/ScaleTransform"/>
				<updated>2013-02-15T09:53:25Z</updated>
		
		<summary type="html">&lt;p&gt;Createdbyx: Provided a method that can scale a transform to a specific size&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The ScaleTransform method allows you to scale a GameObject transform to a specific size along the x &amp;amp; z axis by taking into account the GameObjects renderer bounds if a renderer component is attached. Also takes into account any children of the transform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// Scales a transform to specific dimensions along the x &amp;amp; z axis.&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        /// &amp;lt;param name=&amp;quot;transform&amp;quot;&amp;gt;&lt;br /&gt;
        /// Reference to the transform to scale.&lt;br /&gt;
        /// &amp;lt;/param&amp;gt;&lt;br /&gt;
        /// &amp;lt;param name=&amp;quot;width&amp;quot;&amp;gt;The width along the x axis that represents the target size.&amp;lt;/param&amp;gt;&lt;br /&gt;
        /// &amp;lt;param name=&amp;quot;height&amp;quot;&amp;gt;The height along the z axis that represents the target size.&amp;lt;/param&amp;gt;&lt;br /&gt;
        public static void ScaleTransform(Transform transform, float width, float height)&lt;br /&gt;
        {&lt;br /&gt;
            // get bounds of the prefab&lt;br /&gt;
            var bounds = new Bounds();&lt;br /&gt;
            var encapsulate = false;&lt;br /&gt;
            if (!Utilities.Helpers.GetBoundWithChildren(transform, ref bounds, ref encapsulate))&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // get minimum size from the size dimensions&lt;br /&gt;
            var min = Mathf.Min(width, height);&lt;br /&gt;
&lt;br /&gt;
            // get the maximum x or z size of the transform&lt;br /&gt;
            var max = Mathf.Max(bounds.size.x, bounds.size.z);&lt;br /&gt;
&lt;br /&gt;
            // calculate the scale factor &lt;br /&gt;
            var scaleFactor = min / max;&lt;br /&gt;
&lt;br /&gt;
            // apply scaling to the transform&lt;br /&gt;
            transform.localScale *= scaleFactor;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// Gets the rendering bounds of the transform.&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        /// &amp;lt;param name=&amp;quot;transform&amp;quot;&amp;gt;The game object to get the bounding box for.&amp;lt;/param&amp;gt;&lt;br /&gt;
        /// &amp;lt;param name=&amp;quot;pBound&amp;quot;&amp;gt;The bounding box reference that will &amp;lt;/param&amp;gt;&lt;br /&gt;
        /// &amp;lt;param name=&amp;quot;encapsulate&amp;quot;&amp;gt;Used to determine if the first bounding box to be &lt;br /&gt;
        /// calculated should be encapsulated into the &amp;lt;see cref=&amp;quot;pBound&amp;quot;/&amp;gt; argument.&amp;lt;/param&amp;gt;&lt;br /&gt;
        /// &amp;lt;returns&amp;gt;Returns true if at least one bounding box was calculated.&amp;lt;/returns&amp;gt;&lt;br /&gt;
        public static bool GetBoundWithChildren(Transform transform, ref Bounds pBound, ref bool encapsulate)&lt;br /&gt;
        {&lt;br /&gt;
            var didOne = false;&lt;br /&gt;
&lt;br /&gt;
            // get 'this' bound&lt;br /&gt;
            if (transform.gameObject.renderer != null)&lt;br /&gt;
            {&lt;br /&gt;
                var bound = transform.gameObject.renderer.bounds;&lt;br /&gt;
                if (encapsulate)&lt;br /&gt;
                {&lt;br /&gt;
                    pBound.Encapsulate(bound.min);&lt;br /&gt;
                    pBound.Encapsulate(bound.max);&lt;br /&gt;
                }&lt;br /&gt;
                else&lt;br /&gt;
                {&lt;br /&gt;
                    pBound.min = bound.min; &lt;br /&gt;
                    pBound.max = bound.max; &lt;br /&gt;
                    encapsulate = true;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                didOne = true;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // union with bound(s) of any/all children&lt;br /&gt;
            foreach (Transform child in transform)&lt;br /&gt;
            {&lt;br /&gt;
                if (GetBoundWithChildren(child, ref pBound, ref encapsulate))&lt;br /&gt;
                {&lt;br /&gt;
                    didOne = true;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            return didOne;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;/div&gt;</summary>
		<author><name>Createdbyx</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/CurveEditorTools</id>
		<title>CurveEditorTools</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/CurveEditorTools"/>
				<updated>2013-02-15T01:31:24Z</updated>
		
		<summary type="html">&lt;p&gt;Bunny83: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
A tool window that allows to replace the presets list in Unity's animation curve editor. It was just written as a quick an dirty solution but is already quite polished.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
This is an '''editor script''', so you have to place it in an Editor folder (any subfolder named &amp;quot;Editor&amp;quot;). The filename has to be &amp;quot;CurveEditorTools.cs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
To use this tool you have to open the window by clicking on &amp;quot;CurveEditorTools&amp;quot; in the &amp;quot;Tools&amp;quot; menu. You have to keep the window open while you edit an animation curve. The window will grab the last edited curve automatically which can be named and added to the preset list. You can enable / disable a preset by clicking on the &amp;quot;On&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
When the &amp;quot;Overwrite Preset array&amp;quot; button is active (green), the Editorwindow will inject the new preset list into the AnimationCurve editor as soon as one is opened.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code (CurveEditorTools.cs) ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// CurveEditorTools.cs&lt;br /&gt;
/******************** &lt;br /&gt;
 * &lt;br /&gt;
 * Utility window to Add / Remove / Manage additional presets in the AnimationCurve-&lt;br /&gt;
 * Editorwindow of the Unity3D editor.&lt;br /&gt;
 * &lt;br /&gt;
 * This is an editor script and should be placed in a subfolder called &amp;quot;Editor&amp;quot;.&lt;br /&gt;
 * &lt;br /&gt;
 * Written 2013.02.14 by Bunny83 for the UnityAnswers question:&lt;br /&gt;
 * http://answers.unity3d.com/questions/37664/editorguicurvefield-presets.html&lt;br /&gt;
 *&lt;br /&gt;
 * Usage:&lt;br /&gt;
 * To open the window select &amp;quot;CurveEditorTools&amp;quot; from the &amp;quot;Tools&amp;quot; menu inside Unity&lt;br /&gt;
 * If you don't have a &amp;quot;Tools&amp;quot; menu, you might need to open any other menu to make it appear&lt;br /&gt;
 * for the first time. If the menu still won't show up, check for any compiler errors and&lt;br /&gt;
 * make sure you placed the script in an &amp;quot;Editor&amp;quot; folder and named the file &amp;quot;CurveEditorTools.cs&amp;quot;.&lt;br /&gt;
 *&lt;br /&gt;
 * This script uses reflection to access internal classes of the UnityEditor. Keep in mind that&lt;br /&gt;
 * those classes aren't ment to be used by extensions and might get changed by a future Update&lt;br /&gt;
 * of Unity. This could break the functionality of the extension or might even cause other problems.&lt;br /&gt;
 * I tried to catch as much errors as possible, but it's still a minor risk.&lt;br /&gt;
 *&lt;br /&gt;
 ********************/&lt;br /&gt;
&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEditor;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
&lt;br /&gt;
public class CurveEditorWindowWrapper&lt;br /&gt;
{&lt;br /&gt;
    private static Type m_CurveEditorWindowType = null;&lt;br /&gt;
    private static FieldInfo m_SharedInstanceField = null;&lt;br /&gt;
    private static FieldInfo m_CurveField = null;&lt;br /&gt;
    private static FieldInfo m_PresetsField = null;&lt;br /&gt;
&lt;br /&gt;
    static CurveEditorWindowWrapper()&lt;br /&gt;
    {&lt;br /&gt;
        var assembly = Assembly.GetAssembly(typeof(EditorWindow));&lt;br /&gt;
        var types = assembly.GetTypes();&lt;br /&gt;
        foreach(var T in types)&lt;br /&gt;
        {&lt;br /&gt;
            if (T.Name == &amp;quot;CurveEditorWindow&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                m_CurveEditorWindowType = T;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        if (m_CurveEditorWindowType == null)&lt;br /&gt;
            throw new Exception(&amp;quot;Can't get CurveEditorWindow type. Maybe it has been removed in a newer version of Unity&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        m_SharedInstanceField  = m_CurveEditorWindowType.GetField(&amp;quot;s_SharedCurveEditor&amp;quot;, BindingFlags.NonPublic | BindingFlags.Static);&lt;br /&gt;
        if (m_SharedInstanceField == null)&lt;br /&gt;
            throw new Exception(&amp;quot;Can't get static var 's_SharedCurveEditor' of CurveEditorWindow. Maybe it has been removed in a newer version of Unity&amp;quot;);&lt;br /&gt;
        m_CurveField = m_CurveEditorWindowType.GetField(&amp;quot;m_Curve&amp;quot;, BindingFlags.NonPublic | BindingFlags.Instance);&lt;br /&gt;
        if (m_CurveField == null)&lt;br /&gt;
            throw new Exception(&amp;quot;Can't get var 'm_Curve' of CurveEditorWindow. Maybe it has been removed in a newer version of Unity&amp;quot;);&lt;br /&gt;
        m_PresetsField = m_CurveEditorWindowType.GetField(&amp;quot;m_Presets&amp;quot;, BindingFlags.NonPublic | BindingFlags.Instance);&lt;br /&gt;
        if (m_PresetsField == null)&lt;br /&gt;
            throw new Exception(&amp;quot;Can't get var 'm_PresetsField' of CurveEditorWindow. Maybe it has been removed in a newer version of Unity&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static EditorWindow GetCurrentCurveEditor()&lt;br /&gt;
    {&lt;br /&gt;
        return (EditorWindow)m_SharedInstanceField.GetValue(null);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static AnimationCurve GetCurrentAnimationCurve()&lt;br /&gt;
    {&lt;br /&gt;
        var CEW = GetCurrentCurveEditor();&lt;br /&gt;
        if (CEW == null)&lt;br /&gt;
            return null;&lt;br /&gt;
        return (AnimationCurve)m_CurveField.GetValue(CEW);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static AnimationCurve[] Presets&lt;br /&gt;
    {&lt;br /&gt;
        get&lt;br /&gt;
        {&lt;br /&gt;
            var CEW = GetCurrentCurveEditor();&lt;br /&gt;
            if (CEW == null)&lt;br /&gt;
                return null;&lt;br /&gt;
            return (AnimationCurve[])m_PresetsField.GetValue(CEW);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        set&lt;br /&gt;
        {&lt;br /&gt;
            var CEW = GetCurrentCurveEditor();&lt;br /&gt;
            if (CEW == null)&lt;br /&gt;
                return;&lt;br /&gt;
            m_PresetsField.SetValue(CEW,value);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public class AnimationCurvePreset&lt;br /&gt;
{&lt;br /&gt;
    public const string m_ItemSeperator = &amp;quot;|&amp;quot;;&lt;br /&gt;
    public const string m_SubItemSeperator = &amp;quot;^&amp;quot;;&lt;br /&gt;
    public string name;&lt;br /&gt;
    public AnimationCurve curve;&lt;br /&gt;
    public bool active = true;&lt;br /&gt;
&lt;br /&gt;
    public AnimationCurvePreset(string aName, AnimationCurve aCurve)&lt;br /&gt;
    {&lt;br /&gt;
        name = aName.Replace(m_ItemSeperator,&amp;quot;&amp;quot;).Replace(m_SubItemSeperator,&amp;quot;&amp;quot;);&lt;br /&gt;
        curve = aCurve;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public AnimationCurvePreset(string aSerializedData)&lt;br /&gt;
    {&lt;br /&gt;
        var tmp = aSerializedData.Split(m_SubItemSeperator[0]);&lt;br /&gt;
        int index = 0;&lt;br /&gt;
        name = tmp[index++];&lt;br /&gt;
        active = bool.Parse(tmp[index++]);&lt;br /&gt;
        int keyFrameCount = int.Parse(tmp[index++]);&lt;br /&gt;
        Keyframe[] keyframes = new Keyframe[keyFrameCount];&lt;br /&gt;
        for (int i = 0; i &amp;lt; keyFrameCount; i++)&lt;br /&gt;
        {&lt;br /&gt;
            float time = float.Parse(tmp[index++]);&lt;br /&gt;
            float val = float.Parse(tmp[index++]);&lt;br /&gt;
            float inTan = float.Parse(tmp[index++]);&lt;br /&gt;
            float outTan = float.Parse(tmp[index++]);&lt;br /&gt;
            keyframes[i] = new Keyframe(time,val, inTan, outTan);&lt;br /&gt;
        }&lt;br /&gt;
        curve = new AnimationCurve(keyframes);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public string Serialize()&lt;br /&gt;
    {&lt;br /&gt;
        string Data = name;&lt;br /&gt;
        Data += m_SubItemSeperator + active;&lt;br /&gt;
        Data += m_SubItemSeperator + curve.keys.Length;&lt;br /&gt;
        foreach(var K in curve.keys)&lt;br /&gt;
        {&lt;br /&gt;
            Data += m_SubItemSeperator + K.time;&lt;br /&gt;
            Data += m_SubItemSeperator + K.value;&lt;br /&gt;
            Data += m_SubItemSeperator + K.inTangent;&lt;br /&gt;
            Data += m_SubItemSeperator + K.outTangent;&lt;br /&gt;
        }&lt;br /&gt;
        return Data;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class CurveEditorTools : EditorWindow&lt;br /&gt;
{&lt;br /&gt;
    [MenuItem(&amp;quot;Tools/CurveEditorTools&amp;quot;)]&lt;br /&gt;
    public static void Init()&lt;br /&gt;
    {&lt;br /&gt;
        var win = GetWindow&amp;lt;CurveEditorTools&amp;gt;();&lt;br /&gt;
        try&lt;br /&gt;
        {&lt;br /&gt;
            CurveEditorWindowWrapper.GetCurrentCurveEditor();&lt;br /&gt;
        }&lt;br /&gt;
        catch&lt;br /&gt;
        {&lt;br /&gt;
            win.Close();&lt;br /&gt;
            &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    AnimationCurve m_Curve = null;&lt;br /&gt;
    List&amp;lt;AnimationCurvePreset&amp;gt; m_LocalPresets = new List&amp;lt;AnimationCurvePreset&amp;gt;();&lt;br /&gt;
    List&amp;lt;AnimationCurvePreset&amp;gt; m_DeleteList = new List&amp;lt;AnimationCurvePreset&amp;gt;();&lt;br /&gt;
    string m_NewCurveName = &amp;quot;NewCurve&amp;quot;;&lt;br /&gt;
    bool m_AutoSet = false;&lt;br /&gt;
    Vector2 m_ScrollPos = Vector2.zero;&lt;br /&gt;
&lt;br /&gt;
    void OnEnable()&lt;br /&gt;
    {   &lt;br /&gt;
        EditorApplication.update += OnUpdate;&lt;br /&gt;
        LoadSettings();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    void OnDisable()&lt;br /&gt;
    {&lt;br /&gt;
        EditorApplication.update -= OnUpdate;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    bool CompareCurves(AnimationCurve C1, AnimationCurve C2)&lt;br /&gt;
    {&lt;br /&gt;
        if ((C1 == C2)                              )            return true;&lt;br /&gt;
        if (C1 == null || C2 == null)                            return false;&lt;br /&gt;
        if (C1.keys.Length != C2.keys.Length)                    return false;&lt;br /&gt;
        for (int i = 0; i &amp;lt; C1.keys.Length; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (C1.keys[i].inTangent != C2.keys[i].inTangent)    return false;&lt;br /&gt;
            if (C1.keys[i].outTangent != C2.keys[i].outTangent)  return false;&lt;br /&gt;
            if (C1.keys[i].time != C2.keys[i].time)              return false;&lt;br /&gt;
            if (C1.keys[i].value != C2.keys[i].value)            return false;&lt;br /&gt;
        }&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    void OnUpdate()&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {&lt;br /&gt;
            var curve = CurveEditorWindowWrapper.GetCurrentAnimationCurve();&lt;br /&gt;
            if (curve != null)&lt;br /&gt;
            {&lt;br /&gt;
                if (!CompareCurves(curve, m_Curve))&lt;br /&gt;
                {&lt;br /&gt;
                    m_Curve = curve;&lt;br /&gt;
                    Repaint();&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            if (m_AutoSet)&lt;br /&gt;
            {&lt;br /&gt;
                var tmp = new List&amp;lt;AnimationCurve&amp;gt;();&lt;br /&gt;
                foreach (var P in m_LocalPresets)&lt;br /&gt;
                {&lt;br /&gt;
                    if (P.active)&lt;br /&gt;
                        tmp.Add(P.curve);&lt;br /&gt;
                }&lt;br /&gt;
                CurveEditorWindowWrapper.Presets = tmp.ToArray();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch(Exception e)&lt;br /&gt;
        {&lt;br /&gt;
            Debug.LogError(&amp;quot;CurveEditorTools: Error: &amp;quot; + e.Message);&lt;br /&gt;
            Debug.LogWarning(&amp;quot;CurveEditorTools: Something went wrong during the Update callback, window closed!&amp;quot;);&lt;br /&gt;
            Close();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    void OnGUI()&lt;br /&gt;
    {&lt;br /&gt;
        Color oldColor = GUI.color;&lt;br /&gt;
        GUILayout.BeginHorizontal();&lt;br /&gt;
        GUILayout.BeginVertical(&amp;quot;&amp;quot;, &amp;quot;box&amp;quot;, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(false));&lt;br /&gt;
        GUILayout.Label(&amp;quot;Last Curve&amp;quot;);&lt;br /&gt;
        Rect R = GUILayoutUtility.GetRect(300,300,100,100,GUILayout.Width(200));&lt;br /&gt;
        GUI.enabled = m_Curve != null;&lt;br /&gt;
        if (GUI.GetNameOfFocusedControl() == &amp;quot;PresetName&amp;quot; &amp;amp;&amp;amp; m_NewCurveName != null &amp;amp;&amp;amp; m_Curve != null)&lt;br /&gt;
        {&lt;br /&gt;
            if (Event.current.type == EventType.KeyDown &amp;amp;&amp;amp; Event.current.keyCode == KeyCode.Return)&lt;br /&gt;
            {&lt;br /&gt;
                m_LocalPresets.Add(new AnimationCurvePreset(m_NewCurveName, m_Curve));&lt;br /&gt;
                SaveSettings();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        GUI.SetNextControlName(&amp;quot;PresetName&amp;quot;);&lt;br /&gt;
        m_NewCurveName = GUILayout.TextField(m_NewCurveName);&lt;br /&gt;
        if (m_NewCurveName != &amp;quot;&amp;quot; &amp;amp;&amp;amp; GUILayout.Button(&amp;quot;Save Curve As\n&amp;quot;+m_NewCurveName))&lt;br /&gt;
        {&lt;br /&gt;
            m_LocalPresets.Add(new AnimationCurvePreset(m_NewCurveName, m_Curve));&lt;br /&gt;
            SaveSettings();&lt;br /&gt;
            m_NewCurveName = &amp;quot;&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        GUI.enabled = true;&lt;br /&gt;
        if (m_Curve != null)&lt;br /&gt;
        {&lt;br /&gt;
            EditorGUIUtility.DrawCurveSwatch(R, m_Curve, null, Color.green, Color.black);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            GUI.Label(R,&amp;quot;No Curve yet&amp;quot;,&amp;quot;box&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        GUILayout.EndVertical();&lt;br /&gt;
        GUILayout.FlexibleSpace();&lt;br /&gt;
        GUILayout.EndHorizontal();&lt;br /&gt;
        GUI.color = (m_AutoSet)?Color.green:Color.red;&lt;br /&gt;
        m_AutoSet = GUILayout.Toggle(m_AutoSet, &amp;quot;Overwrite Preset array&amp;quot;, &amp;quot;Button&amp;quot;);&lt;br /&gt;
        GUI.color = oldColor;&lt;br /&gt;
        m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos);&lt;br /&gt;
        GUILayout.BeginHorizontal(&amp;quot;&amp;quot;,&amp;quot;box&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        foreach (var P in m_LocalPresets)&lt;br /&gt;
        {&lt;br /&gt;
            GUI.color = (P.active)?Color.green:oldColor;&lt;br /&gt;
&lt;br /&gt;
            GUILayout.BeginVertical(&amp;quot;&amp;quot;, &amp;quot;box&amp;quot;, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(false));&lt;br /&gt;
            GUILayout.Label(P.name);&lt;br /&gt;
            Rect R2 = GUILayoutUtility.GetRect(120, 120, 80, 80, GUILayout.Width(120));&lt;br /&gt;
            EditorGUIUtility.DrawCurveSwatch(R2, P.curve, null, Color.green, Color.black);&lt;br /&gt;
            GUILayout.BeginHorizontal();&lt;br /&gt;
            P.active = GUILayout.Toggle(P.active,&amp;quot;On&amp;quot;,&amp;quot;Button&amp;quot;);&lt;br /&gt;
            if (GUILayout.Button(&amp;quot;delete&amp;quot;))&lt;br /&gt;
            {&lt;br /&gt;
                if (EditorUtility.DisplayDialog(&amp;quot;Delete Preset?&amp;quot;, &amp;quot;Are you sure you want to delete the preset named '&amp;quot;+P.name+&amp;quot;' ?&amp;quot;, &amp;quot;ok&amp;quot;, &amp;quot;cancel&amp;quot;))&lt;br /&gt;
                {&lt;br /&gt;
                    m_DeleteList.Add(P);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            GUILayout.EndHorizontal();&lt;br /&gt;
&lt;br /&gt;
            GUILayout.EndVertical();&lt;br /&gt;
        }&lt;br /&gt;
        GUI.color = oldColor;&lt;br /&gt;
        if (GUI.changed)&lt;br /&gt;
            SaveSettings();&lt;br /&gt;
        GUILayout.FlexibleSpace();&lt;br /&gt;
        GUILayout.EndHorizontal();&lt;br /&gt;
        GUILayout.EndScrollView();&lt;br /&gt;
        if (m_DeleteList.Count &amp;gt; 0 &amp;amp;&amp;amp; Event.current.type == EventType.Repaint)&lt;br /&gt;
        {&lt;br /&gt;
            foreach (var P in m_DeleteList)&lt;br /&gt;
            {&lt;br /&gt;
                m_LocalPresets.Remove(P);&lt;br /&gt;
            }&lt;br /&gt;
            m_DeleteList.Clear();&lt;br /&gt;
            Repaint();&lt;br /&gt;
            SaveSettings();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    void SaveSettings()&lt;br /&gt;
    {&lt;br /&gt;
        string Data = &amp;quot;&amp;quot;;&lt;br /&gt;
        foreach (var P in m_LocalPresets)&lt;br /&gt;
        {&lt;br /&gt;
            Data += P.Serialize() + AnimationCurvePreset.m_ItemSeperator;&lt;br /&gt;
        }&lt;br /&gt;
        Data = Data.Remove(Data.Length-1);&lt;br /&gt;
        EditorPrefs.SetString(&amp;quot;CustomCurveEditorPresets&amp;quot;, Data);&lt;br /&gt;
        EditorPrefs.SetBool(&amp;quot;CustomCurveEditor_AutoSet&amp;quot;, m_AutoSet);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    void LoadSettings()&lt;br /&gt;
    {&lt;br /&gt;
        m_AutoSet = EditorPrefs.GetBool(&amp;quot;CustomCurveEditor_AutoSet&amp;quot;, false);&lt;br /&gt;
        string Data = EditorPrefs.GetString(&amp;quot;CustomCurveEditorPresets&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
        if (Data != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            m_LocalPresets.Clear();&lt;br /&gt;
            var tmp = Data.Split(AnimationCurvePreset.m_ItemSeperator[0]);&lt;br /&gt;
            foreach (var S in tmp)&lt;br /&gt;
            {&lt;br /&gt;
                m_LocalPresets.Add(new AnimationCurvePreset(S));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:C Sharp]]&lt;br /&gt;
[[Category:Utility]]&lt;br /&gt;
[[Category:EditorWindow]]&lt;br /&gt;
[[Category:Editor Scripts]]&lt;/div&gt;</summary>
		<author><name>Bunny83</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/Special_Folder_Names_in_your_Assets_Folder</id>
		<title>Special Folder Names in your Assets Folder</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/Special_Folder_Names_in_your_Assets_Folder"/>
				<updated>2013-02-11T10:46:31Z</updated>
		
		<summary type="html">&lt;p&gt;AnomalousUnderdog: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some names for folders have special properties in Unity. Until the official docs creates a page for this information, hopefully this page will help developers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Standard Assets ==&lt;br /&gt;
Scripts in here are always compiled first. Scripts are output to either Assembly-CSharp-firstpass, Assembly-UnityScript-firstpass, or Assembly-Boo-firstpass, depending on the language. See http://docs.unity3d.com/Documentation/ScriptReference/index.Script_compilation_28Advanced29.html&lt;br /&gt;
&lt;br /&gt;
Placing scripts in Standard Assets is one way for C# scripts to be able to access .js scripts or vice-versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pro Standard Assets ==&lt;br /&gt;
Same with Standard Assets, only files here are meant for the Pro version. This means assets here make use of Pro-only features like render textures and screen-space effects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Editor ==&lt;br /&gt;
The Editor folder name is a special name which allows your scripts access to the Unity Editor Scripting API. If your script uses any classes or functionality from the UnityEditor namespace, it has to be placed in a folder called Editor. You can have multiple Editor folders throughout your project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugins ==&lt;br /&gt;
The &amp;quot;Plugins&amp;quot; folder is where you must put any native plugins, which you want to be accessible by your scripts. They will also be automatically included in your build. Take note that this folder may not be in any subfolder (it has to reside within the top-level Assets folder).&lt;br /&gt;
&lt;br /&gt;
In Windows, native plugins exist as .dll files, in Mac OS X, they are .bundle files, and in Linux, they are .so files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Plugins/x86 ===&lt;br /&gt;
If you are building for 32-bit or a universal (both 32 and 64 bit) platform, and if this subfolder exists, any native plugin files in this folder will automatically be included in your build. If this folder does not exist, Unity will look for native plugins inside the parent Plugins folder instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Plugins/x86_64 ===&lt;br /&gt;
If you are building for 64-bit or a universal (both 32 and 64 bit) platform, and if this subfolder exists, any native plugin files in this folder will automatically be included in your build. If this folder does not exist, Unity will look for native plugins inside the parent Plugins folder instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are making a universal build, it's recommended you make both the x86 and x86_64 subfolders. Then have the 32-bit and 64-bit versions of your native plugins in the proper subfolder correspondingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Plugins/Android ===&lt;br /&gt;
Place here any Java .jar files you want included in your Android project, used for Java-based plugins. Any .so file (when having Android NDK-based plugins) will also be included. See http://docs.unity3d.com/Documentation/Manual/PluginsForAndroid.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Plugins/iOS ===&lt;br /&gt;
A limited, simple way to automatically add (as symbolic links) any .a, .m, .mm, .c, or .cpp files into the generated Xcode project. See http://docs.unity3d.com/Documentation/Manual/PluginsForIOS.html&lt;br /&gt;
&lt;br /&gt;
If you need more control how to automatically add files to the Xcode project, you should make use of the PostprocessBuildPlayer feature. Doing so does not require you to place your files in the Plugins/iOS folder. See http://docs.unity3d.com/Documentation/Manual/BuildPlayerPipeline.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
The Resources folder is a special folder which allows you to access assets by file path and name in your scripts, rather than by the usual (and recommended) method of direct references (as variables in scripts).&lt;br /&gt;
&lt;br /&gt;
For this reason, caution is advised when using it. All assets you put in the Resources folder are always included in your build (even unused ones), because Unity has no way of determining which Resources-based assets are used or not.&lt;br /&gt;
&lt;br /&gt;
You can have multiple Resources folders throughout your project, so it is not recommended to have an asset in one Resources folder and have another asset with that same name in another Resources folder.&lt;br /&gt;
&lt;br /&gt;
Once your game is built, all assets in all Resources folders get packed into the game's archive for assets. This means the Resources folder technically doesn't exist anymore even though your code will still access them via the paths that exist in your project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Gizmos ==&lt;br /&gt;
The gizmos folder holds all the texture/icon assets for use with Gizmos.DrawIcon(). Texture assets placed inside this folder can be called by name, and drawn on-screen as a gizmo in the editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== WebPlayerTemplates ==&lt;br /&gt;
Used to replace the default web page used for web builds. Any scripts placed here will not be compiled at all. This folder has to be in your top-level Assets folder (it should not be in any subfolder in your Assets directory).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== StreamingAssets ==&lt;br /&gt;
Any files in here are copied to the build folder as is, without any changes (except for mobile and web builds). The path where they are can vary per platform but is accessible via Application.streamingAssetsPath (http://docs.unity3d.com/Documentation/ScriptReference/Application-streamingAssetsPath.html)&lt;/div&gt;</summary>
		<author><name>AnomalousUnderdog</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/Csharp_Coding_Guidelines</id>
		<title>Csharp Coding Guidelines</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/Csharp_Coding_Guidelines"/>
				<updated>2013-02-08T14:53:25Z</updated>
		
		<summary type="html">&lt;p&gt;Daniel Moss: /* Comment Style */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This guide is by no means a bible on how to write good code, but shows how to format code to make readability easier, and code cleaner.&lt;br /&gt;
--[[User:Daniel Moss|Daniel Moss]] ([[User talk:Daniel Moss|talk]]) 16:10, 8 February 2013 (CET)&lt;br /&gt;
&lt;br /&gt;
==Style Guidelines==&lt;br /&gt;
&lt;br /&gt;
Below are good practices for code styling&lt;br /&gt;
&lt;br /&gt;
===Bracing===&lt;br /&gt;
Open braces should always be at the beginning of the line after the statement that begins the block. Contents of the brace should be indented by 1 tab or 4 spaces. For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
if (someExpression)&lt;br /&gt;
{&lt;br /&gt;
   DoSomething();&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
   DoSomethingElse();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
“case” statements should be indented from the switch statement like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
switch (someExpression) &lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   case 0:&lt;br /&gt;
      DoSomething();&lt;br /&gt;
      break;&lt;br /&gt;
&lt;br /&gt;
   case 1:&lt;br /&gt;
      DoSomethingElse();&lt;br /&gt;
      break;&lt;br /&gt;
&lt;br /&gt;
   case 2: &lt;br /&gt;
      {&lt;br /&gt;
         int n = 1;&lt;br /&gt;
         DoAnotherThing(n);&lt;br /&gt;
      }&lt;br /&gt;
      break;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Braces should never be considered optional. Even for single statement blocks, you should always use braces. This increases code readability and maintainability.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;for (int i=0; i&amp;lt;100; i++) { DoSomething(i); }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Single line statements===&lt;br /&gt;
Single line statements can have braces that begin and end on the same line.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
public class Foo&lt;br /&gt;
{&lt;br /&gt;
   int bar;&lt;br /&gt;
&lt;br /&gt;
   public int Bar&lt;br /&gt;
   {&lt;br /&gt;
      get { return bar; }&lt;br /&gt;
      set { bar = value; }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is suggested that all control structures (if, while, for, etc.) use braces, but it is not required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Commenting===&lt;br /&gt;
Comments should be used to describe intention, algorithmic overview, and/or logical flow.  It would be ideal, if from reading the comments alone, someone other than the author could understand a function’s intended behavior and general operation. While there are no minimum comment requirements and certainly some very small routines need no commenting at all, it is hoped that most routines will have comments reflecting the programmer’s intent and approach.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Comment Style===&lt;br /&gt;
&lt;br /&gt;
The // (two slashes) style of comment tags should be used in most situations. Where ever possible, place comments above the code instead of beside it.  Here are some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
// This is required for Controller access for hit detection&lt;br /&gt;
FPSController controller = hit.GetComponent&amp;lt;FPSController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Creare a new ray against the ground&lt;br /&gt;
//&lt;br /&gt;
Ray ray = new Ray(hit.transform.position, -Vector3.up);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comments can be placed at the end of a line when space allows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
public class SomethingUseful &lt;br /&gt;
{&lt;br /&gt;
    private int          itemHash;            // instance member&lt;br /&gt;
    private static bool  hasDoneSomething;    // static member&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Spacing===&lt;br /&gt;
&lt;br /&gt;
Spaces improve readability by decreasing code density. Here are some guidelines for the use of space characters within code:&lt;br /&gt;
&lt;br /&gt;
Do use a single space after a comma between function arguments.&lt;br /&gt;
Right:          &amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;Console.In.Read(myChar, 0, 1);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Wrong:       &amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt; Console.In.Read(myChar,0,1); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Do not use a space after the parenthesis and function arguments&lt;br /&gt;
Right:           &amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;CreateFoo(myChar, 0, 1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Wrong:       &amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt; CreateFoo( myChar, 0, 1 )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Do not use spaces between a function name and parenthesis.&lt;br /&gt;
Right:          &amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt; CreateFoo()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Wrong:       &amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt; CreateFoo ()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Do not use spaces inside brackets.&lt;br /&gt;
Right:    &amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt; x = dataArray[index];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Wrong:      &amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;  x = dataArray[ index ];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Do use a single space before flow control statements&lt;br /&gt;
Right:           &amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;while (x == y)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Wrong:       &amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt; while(x==y)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Do use a single space before and after comparison operators&lt;br /&gt;
Right:          &amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt; if (x == y)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Wrong:        &amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt; if (x==y)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Naming===&lt;br /&gt;
&lt;br /&gt;
*'''Do not''' use Hungarian notation&lt;br /&gt;
*'''Do not''' use a prefix for member variables (_, m_, s_, etc.). If you want to distinguish between local and member variables you should use “this.” in C# and “Me.” in VB.NET.&lt;br /&gt;
*'''Do''' use camelCasing for member variables&lt;br /&gt;
*'''Do''' use camelCasing for parameters&lt;br /&gt;
*'''Do''' use camelCasing for local variables&lt;br /&gt;
*'''Do''' use PascalCasing for function, property, event, and class names&lt;br /&gt;
*'''Do''' prefix interfaces names with “I”&lt;br /&gt;
*'''Do''' not prefix enums, classes, or delegates with any letter&lt;br /&gt;
&lt;br /&gt;
===File Organization===&lt;br /&gt;
*Source files should contain only one public type, although multiple internal classes are allowed&lt;br /&gt;
*Source files should be given the name of the public class in the file&lt;br /&gt;
*Classes member should be alphabetized, and grouped into sections (Fields, Constructors, Properties, Events, Methods, Private interface implementations, Nested types)&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
&lt;br /&gt;
public class MyClass : MonoBehavior&lt;br /&gt;
{&lt;br /&gt;
    // fields&lt;br /&gt;
    int foo;&lt;br /&gt;
&lt;br /&gt;
    // properties&lt;br /&gt;
    public int Foo { get { … } set { … } }&lt;br /&gt;
&lt;br /&gt;
    // methods&lt;br /&gt;
    void MyMethod(int number)&lt;br /&gt;
    {&lt;br /&gt;
        int value = number + 2;&lt;br /&gt;
        Debug.Log(value);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==More Soon==&lt;/div&gt;</summary>
		<author><name>Daniel Moss</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php/Linux_system_profiler.bash</id>
		<title>Linux system profiler.bash</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php/Linux_system_profiler.bash"/>
				<updated>2013-02-07T18:37:32Z</updated>
		
		<summary type="html">&lt;p&gt;Amigojapan: /* Unity3d linux crash system profiler */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Unity3d linux crash system profiler ==&lt;br /&gt;
&lt;br /&gt;
This is a tool that will help you gather information about the linux computer and also it will gather the information about the crash of your unity program, you should distribute this program with every linux unity program you have so your users can send you the information about the crash of their program and you can submit a bug report in their behalf.&amp;lt;BR&amp;gt;&lt;br /&gt;
Go into the directory where your_unity_binary_name is located&amp;lt;BR&amp;gt;&lt;br /&gt;
run it as:$bash unity3d_linux_system_profiler.bash your_unity_binary_name&amp;lt;BR&amp;gt;&lt;br /&gt;
Once the Unity3d_system_profile.txt file is created, open Unity3d go to the Help Menu -&amp;gt; Report a bug&amp;lt;BR&amp;gt;&lt;br /&gt;
Then attach the Unity3d_system_profile.txt file together with your program.&amp;lt;BR&amp;gt;&lt;br /&gt;
In the Problem details dialog box, include the following:&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
I am filing this bug report on behalf of one of my users&amp;lt;BR&amp;gt;&lt;br /&gt;
1) What happened&amp;lt;BR&amp;gt;&lt;br /&gt;
This bug happened in Linux&amp;lt;BR&amp;gt;&lt;br /&gt;
I have attached this info in the file Unity3d_system_profile.txt&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
2) How can we reproduce it using the example you attached&amp;lt;BR&amp;gt;&lt;br /&gt;
The info in Unity3d_system_profile.txt has the information you need to reproduce this bug&amp;lt;BR&amp;gt;&lt;br /&gt;
This bug report was generated by the following script at; http://wiki.unity3d.com/index.php/Linux_system_profiler.bash#Unity3d_linux_crash_system_profiler&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
Then click Send error report&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: when possible also send a screenshot from the user's computer showing the bug attached to the report and a screenshot showing how it runs in windows.&amp;lt;BR&amp;gt;&lt;br /&gt;
also mention this in the description of the bug report&amp;lt;BR&amp;gt;&lt;br /&gt;
Script:&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;BASH&amp;quot;&amp;gt; &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# This is a tool that will help you gather information about the computer in linux and also it will gather the information about the crash of your unity program, you should distribute this program with every linux unity program you have so your users can send you the information about the crash of their program and you can submit a bug report in their behalf.&lt;br /&gt;
#run as:$bash unity3d_linux_system_profiler.bash your_unity_binary_name&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
#Unity3d crash system profiler&lt;br /&gt;
#Copyright Usmar A. Padow 2013 (amigojapan) usmpadow@gmail.com&lt;br /&gt;
#linux version&lt;br /&gt;
printf &amp;quot;Unity3d linux crash system profiler\n&amp;quot;&lt;br /&gt;
if [ -z $1 ] &lt;br /&gt;
then &lt;br /&gt;
printf &amp;quot;the first argument must be the name of the program\nand you must be in the directory containing the program\nexample: $bash unity3d_linux_system_profiler.bash myprogram\n&amp;quot;&lt;br /&gt;
exit&lt;br /&gt;
fi&lt;br /&gt;
rm Unity3d_System_Profile.txt&lt;br /&gt;
printf &amp;quot;Unity3d linux crash system profiler file\n&amp;quot; &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
printf &amp;quot;Copyright Usmar A. Padow 2013 (amigojapan) usmpadow@gmail.com\n&amp;quot; &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
printf &amp;quot;\n\nLinux version and kernel info:\n&amp;quot; &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
uname -a &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
cat /proc/version &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
#videocard info&lt;br /&gt;
printf &amp;quot;\n\nPCI info, Videocard info, usually under VGA:\n&amp;quot; &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
lspci -v &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
#memory&lt;br /&gt;
printf &amp;quot;\n\nMemory info:\n&amp;quot; &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
cat /proc/meminfo &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
#CPU &lt;br /&gt;
printf &amp;quot;\n\nCPU info:\n&amp;quot; &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
cat /proc/cpuinfo &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
printf &amp;quot;\nProgram binary name:\n&amp;quot; &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
echo $1 &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
while true; do&lt;br /&gt;
    read -p &amp;quot;Did the program exit before starting GUI mode? &amp;quot; yn&lt;br /&gt;
    case $yn in&lt;br /&gt;
        [Yy]* ) &lt;br /&gt;
            printf &amp;quot;Processing...\n&amp;quot;&lt;br /&gt;
            printf &amp;quot;execution error log:\n&amp;quot; &amp;gt;&amp;gt;Unity3d_System_Profile.txt&lt;br /&gt;
            printf &amp;quot;standard output:\n&amp;quot; &amp;gt;&amp;gt;Unity3d_System_Profile.txt&lt;br /&gt;
            ./$1 &amp;gt;&amp;gt;Unity3d_System_Profile.txt&lt;br /&gt;
            printf &amp;quot;stderr:\n&amp;quot; &amp;gt;&amp;gt;Unity3d_System_Profile.txt&lt;br /&gt;
            ./$1 2&amp;gt;&amp;gt;Unity3d_System_Profile.txt&lt;br /&gt;
             printf &amp;quot;Please describe in one line what the bug was. press [enter] when ready to submit:\n&amp;quot;;&lt;br /&gt;
            read user_input&lt;br /&gt;
            printf &amp;quot;\nUser's description of bug:\n&amp;quot; &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
            echo $user_input &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
            printf &amp;quot;OUTPUT stored in Unity3d_System_Profile.txt\n&amp;quot;;break;;&lt;br /&gt;
        [Nn]* ) &lt;br /&gt;
            printf &amp;quot;\n\nThe program entered GUI mode succesfully\n&amp;quot; &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
            printf &amp;quot;Please describe in one line what the bug was. press [enter] when ready to submit:\n&amp;quot;;&lt;br /&gt;
            read user_input&lt;br /&gt;
            printf &amp;quot;\nUser's description of bug:\n&amp;quot; &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
            echo $user_input &amp;gt;&amp;gt;Unity3d_System_Profile.txt;&lt;br /&gt;
            printf &amp;quot;OUTPUT stored in Unity3d_System_Profile.txt\n&amp;quot;;&lt;br /&gt;
            exit;;&lt;br /&gt;
        * ) printf &amp;quot;Please answer yes or no.&amp;quot;;;&lt;br /&gt;
    esac&lt;br /&gt;
done&lt;br /&gt;
 &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If you have problems copying the code from here, try copying the RAW paste data from here http://pastebin.com/mbKyLnpn&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>Tenebrous</name></author>	</entry>

	</feed>