Unity C# scripting trick
A little useful trick when coding, one that many starting developers may not know how to works with, is how to create a script that inherits properties from other scripts.
When creating a new script, you may notice a following line of code when creating a new script:
public class [SCRIPT_NAME] : MonoBehaviour
This signals us a normal unity script, one we ussually may work with. From there, we can add variables and functions that we need.
However, we are able to create a script variant that inherits values from another script of ours by modifying this line to look something like this:
public class [SCRIPT_NAME] : [SCRIPT_NAME_OF_SCRIPT_WE_WANT_TO_INHERIT_CODE_FROM]
And thats it! Our new script will automaticly inherit all variables and functions from our other script during runtime. Both scripts are psychically still seperate, but we can call on functions from our inherited script whenever we need to.