Hello Unity Community,
I am thinking about the most efficient way to code something. Let me explain a little first. (Sry for bad english too)
So imagine i have 2 scripts one for movement and one for my cam;
One of them checks for input and stores it in variables;
I also need this vars/values in the other script, so i can work with them;
So i always think about possibilities:
-
Method
I declare a var with the script type to get the public vars and methods from the other script; -
Method
I create a extra script only for vars to read from it; -
Method
I use the scripting again to get input data from the Unity Engine; -
and so on
You guys tell meβ¦
So my question is, what is the most efficient way to work with vars?
Or is one of the methods unefficient or bad.
Or have you guys other ideas for better scripting in Unity;
Thank you and best regards
Nuri