Unity Tips
Here in this Unity Tips page, it will cover some basics with Unity primarily focused towards the documentation side of things. Within Unity MonoBehaviours, which is what the components, behaviours and blueprints are built off - they have built-in functionality that allows you to quickly resort to external documentation, or show brief tooltips about a specific field.
Entry-Level Tips
Below are some basic tips about how to access the documentation from within your Unity Project. These are considered 'entry-level' as it's basic Unity knowledge.
Internal Documentation
In Unity's built-in Scripting API, it includes these things called a PropertyAttribute. While it's not necessary to know how to use them, it's necessary to know what they do. The specific attribute which we will be taking advantage of is the TooltipAttribute. For each MonoBehaviour (Components, Behaviours and Blueprints) or ScriptableObject (ModDefinition, ModLocalization, ModGearSpawns, etc.), they will have tooltips already applied to them.
- To access these tooltips, begin by either selecting a generated SDK ScriptableObject or attaching a MonoBehaviour to a GameObject.
- Then by simply hovering your mouse over the specific field you want information on within the Unity Inspector, that tooltip will appear. This tooltip provides a shortened version of the documentation within this Wiki.
As you can see in the screenshot below, the user is hovering over the Inventory Category
field. This then prompts the user with a brief explanation on what its purpose is.
External Documentation
Unity also provides an easy built-in way for developers to link specific documentation pages hosted elsewhere for users to easily navigate to. This attribute is known as the HelpURLAttribute, and like before, you don't need to know how to use them - only about what they do. Just like the tip above, this feature is available on both MonoBehaviours and ScriptableObjects.
- To take advantage of this attribute, begin by either selecting a generated SDK ScriptableObject or attaching a MonoBehaviour to a GameObject.
- Then navigate to the top right of the asset, there will be multiple icons - but the one we are focusing on is the question mark. Selecting this icon will redirect the user to more detail documentation about that specific asset.
As you can see in the screenshot below, when the user hovers over the question mark icon for the ModGenericComponent MonoBehaviour - it prompts them that it'll open an external documentation page in the users default browser.
INFO
Other tips such has intermediate and advanced will be added if necessary.