Example of Correct Game Exit in Unity public void Quit() { #if (UNITY_EDITOR || DEVELOPMENT_BUILD) Debug.Log(this.name+" : "+this.GetType()+" : "+System.Reflection.MethodBase.GetCurrentMethod().Name); #endif #if (UNITY_EDITOR) UnityEditor.EditorApplication.isPlaying = false; #endif #if (UNITY_WEBGL || UNITY_STANDALONE || UNITY_IOS || UNITY_ANDROID) Application.Quit(); #endif }
If a question mark appears at the end of the string when processing text from TMP_InputField, it may be due to TMP_InputField adding a zero-width space (0x200B) at the end of the string. You won't see this in the input field itself, but it may appear under certain circumstances when passing the text. This issue can be easily fixed by:
To hide the cursor Cursor.lockState = CursorLockMode.Confined; Cursor.visible = false; To display the cursor Cursor.lockState = CursorLockMode.None; Cursor.visible = true;
Starting from C# 7 version, the language has a feature that allows declaring a local variable that references an array element or a field in an object: int[] simpleArray = {0, 1, 2, 3, 4, 5, 6, 7, 8}; ref int simpleElementRef = ref simpleArra…
This publication was written as a simple instruction for myself, for memory, so as not to forget. The proposed option was used for authorization through a VK token in a server application. First, let's create a method to send an HTTP request and get a response from the server:…
To add support for CorsPolicy in a .NET Core application, open the Startup.cs file and modify the ConfigureServices and Configure methods as follows: ConfigureServices public void ConfigureServices(IServiceCollection services) { // Add...
This article provides an example of getting user information in a domain AD using C#. To make it work, you need to add the following library: using System.DirectoryServices.AccountManagement; Then you can get user parameters.
I recently had to help with the launch of a project under .NET on WCF - on a 64-bit system, the project worked normally on x86 but refused to work on x64. In general, as I expected, the problem was solved quite simply, in addition to the main problem, several others emerged in the process of solving, which required me to get acquainted with a very interesting library <a href="[[B3]]" target="_blank" rel="nofollow noopener external">Emgu CV</a>, which allows you to do a lot of remarkable things, including number plate recognition from an image.
There are no special problems with passing parameters to an application at startup in C#, it's done quite simply like this: static void Main(string[] args) { if (args.Length == 0) { MessageBox.Show("No parameters"); } else { MessageBox.Show("1");…