Hi.
This is my first post in the Unity forums. I’ve been C# coding in Unity since January 2017 and just love it. The online tutorials are great. A shout out of thanks to all those who have created great tutorials on YT including Sebastian Lague, Brackeys, and Hibby to name a few!
Have been building a cybersecurity related application and in the beginning I shared variables (ints, bools, floats, arrays of the same) between objects and C# scripts by the standard GameObject.Find().GetComponent<>() (and similar) methods.
However, recently I was in code housekeeping mode recently (after watching many Sebastian Lague videos) and I rewrote most of my code to use a public static classes for “Globals” and for methods which do not inherit from MonoBehavior. This was not specifically recommended by Sebastian (or anyone); but it just seemed easier to manage and cleaner (for me, at least).
Sorry if this is a dumb post, as I just transitioned from programming mostly in PHP to a “hopeful” C# programmer around 8 months ago; and am enjoying learning C# and very passionate about Unity and the community at large.
To the point, I noticed a huge increase in FPS rate when I moved to public static classes that do not inherit from MonoBehavior for all these shared variables between scripts and objects**.**
Is this normal? If so, why or why not?
Why do I feel like this is a dumb question? LOL
Thanks!