I would classify inheritence slightly below intermediate level programming. It can be sort of ignored in the Unity Component Style but still has many uses.
Event’s and delegates are intermediate level stuff as they are more advanced functions (sorry to actual programmers if I over simplifed that
). When you start getting Events with EventArgs they become really powerful (I have not learnt these yet).
Namespaces shouldn’t be that important right now unless you are building reuseable collections of code across multiple projects. All a namespace is basically a collection of code (scripts, classes etc.) that belong together that you can call on. By default it assumes you are using the code in the current namespace. However if you made a class the same name as a system class (for example a math class) you can specify which class you want to use either System.Math or YourNamespace.Math.
Advanced stuff I’d call the polymorphism stuff mentioned earlier. Though it is linked to inheritence, basic inheritence is easy to understand by comparison. The Unity ref tutorials listed earlier lists them as intermediate so I’m wondering what they classify as hard/advanced.
A rough guide to the “Managers style” (if you don’t know). You have a GameObject that you attach the different manager scripts (Sound manager, GameManager, etc.). you can then in the other scripts add:
public GameManager Gm;
In the inspector drag the GameManager gameObject into the variable in the inspector,
or if you want to link them in code dynamically (like if you are spawning an object in realtime):
public GameManager Gm;
void Start()
{
Gm= FindObjectOfType<GameManager>();
}
GameManager is the name of the Script or class you want to reference on the gameObject. You can replace it or add more like “public AudioManager Am;”.
More generic advice for modular code. Sorry if you already know this stuff.
Basically there is a point where you need to look at planning. Some people like rapid prototyping and then refining the code while others plan from the beginning and build off that.
The stuff about changing things once in a localised area is important. There are multiple things to consider for modular code. One avoid hard coding. Even if you know that a value will always be the same, make it a constant variable. You can also make a static variable that should only exist once and be referenced much easier then normal variables.
Try to make functions more vague/generic (for lack of a better word). Instead of a making seperate shoot functions make one that you pass the weapon, speed and the like.