for this lecture and last section i keep getting errors like this that say Object.FindObjectsOfType is deprecated
is anyone else seeing this?
Assets\GameDev.tv Assets\Scripts\Saving\SavingSystem.cs(89,49): warning CS0618: ‘Object.FindObjectsOfType()’ is obsolete: ‘Object.FindObjectsOfType has been deprecated. Use Object.FindObjectsByType instead which lets you decide whether you need the results sorted or not. FindObjectsOfType sorts the results by InstanceID but if you do not need this using FindObjectSortMode.None is considerably faster.’
but as it happens, you can pass 0, which is equivalent to saying don’t sort it.
As the warning states, FindObjectsByType is considerably faster when the sort mode is none. In fact, if you’re using the result in a Linq expression where you will be sorting it by some other criterion anyways, that initial sort in the deprecated (as of Unity 2023) FindObjectsOfType is a complete waste of computation cycles.