Hello everyone!
Before I used GameMaker and there I could create a script with some common functions and after using it with different objects (for example write function of damage and use it for player and for enemy). Now I want to do something like this in Unity, but I really don’t understand how, because
- Maybe I am wrong, but I suppose that I can use scrit if it is attached to an object
then I decided to attach to GameManager object, but - if I want to use the method in my Player script, I have to create a variable, find object GameManager, get component(script) of the object and only after that I can use this method
But it looks very complicated for this purpose. Maybe there are some simpler way to do this? I tried to find the answer by myself but I failed