You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want an editor exposed variable but slightly faster, use [SerializeField] private GameObject example;
Consider using public const string over public string if it's going to be used every time your game is active
(Preference) Use the new Input System over the old one, as it offers better performance by skipping Update loops
Avoid adding strings together like $"{stg}_5_win.mp4" as it generates memory garbage, instead import ZString and use ZString.Concat(stg, "_5_win.mp4")
(New C#) You can replace stg != 5 with stg is not 5, stg == 5 with stg is 5 and same with strings etc. Note that this only works with constant values, so no dynamic ones
Create a new System.Random instance as a global variable, rather than a method one. private readonly Random rand = new();
Avoid using boxing like (int) as it is often extremely expensive to do and can generate memory garbage
The text was updated successfully, but these errors were encountered:
https://github.com/KoleckOLP/RPScore/blob/master/Assets/MainScript.cs
some tips:
The text was updated successfully, but these errors were encountered: