Unity study notes - records of some minor problems after optimization

missing the class attribute ‘ExtensionOfNativeClass‘

As in the title, when optimizing the code, I found that some scripts do not need to be mounted to the objects in the scene, so I removed the inheritance of monobehavior, and then found that when I started the project, an error message was reported. For example, restarting and modifying the script name are invalid, and
finally
found It is because the references on the objects where these scripts are mounted in the scene have not been removed, and the scripts that have been mounted on those objects need to be removed component, and then no error will be reported when running

insert image description here

https://blog.csdn.net/qq_39108767/article/details/100138887

Scripts that no longer inherit monobehavior use the methods of destruction and generation to report errors

insert image description here
insert image description here
Solution, refer to UnityEngine.Object
insert image description here
or any other monobehavoir script to call, because the parent class of monobehavior is UnityEngine.Object

Guess you like

Origin blog.csdn.net/pure81/article/details/124142563