Having multiple scripts as info sets.
Ok, I want to reference a data set script using a variable name like
'Model_Info'
So then I can access variables and methods like variable = Model_Info.variable; Model_Info.method();
I want to have multiple data set scripts. Example: data_set_1.scr data_set_2.scr data_set_3.scr
The variables in these data sets never change. I will only be using 1 of these for a project. Discarding the rest. So if I can reference one of these scripts only ONE time, it would be extremely efficient for me.
The problem is I don't know how to initialize them so I only have to reference them one time.
A static class looks like "script_name.Model_Info.variable"
I'd like it to be like "Model_Info.variable" so I can keep the reference name a constant.
Answer by ClaytonKashuba · Jan 29, 2018 at 07:10 PM
So to answer my question, what I ended up doing was creating an object, that will be persistant throughout all scenes. Then I attached a script to it Data_Set_2.scr
Then I reference this object with: data = Find.Gameobject("model_info").GetComponent(Data_Set_2).();
So when I change out a data set I only have to do two things: 1) Attach it to the gameobject 2) Change the script name in my reference script.
Your answer

Follow this Question
Related Questions
How do you call variables within a method on a static class? 2 Answers
Wrong Abstract Type 0 Answers
Doing delay or a wait on a static method 0 Answers
Static class in Unity 2 Answers