⌘BABAKOV.NET Let's code!
100% [light] [ru]
~/programming/cs $

.NET C#

89 total · page 1 / 9
Subsections

Correct Game Exit in Unity for Different Cases

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 }

28 views 1 comments 0 likes ./Read →

Question Mark in TMP_Text TextMeshPro Unity

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:

12 views 0 comments 0 likes ./Read →

Example of adding an event to a Button in Unity

Example of adding an event to a Button using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement; public class PanelPaused : MonoBehaviour { public Button buttonContinue; public Button buttonExit; void Start() { buttonContinue…

13 views 0 comments 0 likes ./Read →

Calculating the Maximum Number of Points Belonging to One Line from an Array of Points in C#

Given: An array of points on a plane: points[][] Xi and Yi. Need to find: The maximum number of points that belong to one line. Example: Original array: points= [[1,1],[3,2],[5,3],[4,1],[2,3],[1,4]] Result: 4 Example solution, not the best, but working: Explanation of the algorithm: Create a dictionary where the key is a pair [line equation + index of coordinates in the array].

78 views 0 comments 0 likes ./Read →