It just doesn't work with baseclasses since Untiy don't know which actual class it should attach. In your case it seems that you have one concrete dependency where the attribute can be used just fine. That's why the "Point Effector 2D" component can't use it since it makes no sense to add "some kind" of collider. Note: RequireComponent only works for concrete classes. Public class YourRuntimeScriptName : MonoBehaviour It also includes appropriate messages in instances where URL is not shown or can’t be shown in. This powerful tool shows crawling issues, index status, SEO errors and markup info. Only for newly added components.Īll you have to do is add this attribute to your runtime script: The URL inspection tool allows you to check and take necessary actions on URLs under the domain selected, for crawling, indexing, SEO, markup details and errors. Also if you already have the script attached to a gameobject and add the attribute to the script, it won't add the dependencies either. When you use AddComponent from script to add your class to a gameobject it won't add those dependencies. Just to make that clear: That attribute only affects the behaviour of the editor. YourRuntimeScriptName script = (YourRuntimeScriptName)target ĮditorGUILayout.HelpBox("Health script must be assigend to the same gameobject", MessageType.Warning) ĭo you know the RequireComponent attribute? It will automatically add scripts which your script depend on to the same gameobject when your script is added to a gameobject in the editor. You should check if the component is attached inside the editor script itself. You have to seperate editor code from in game code.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |