#singleton
1 messages · Page 1 of 1 (latest)
Singleton?
Yeah, so at the top, put public static myScriptName instance
Is the reason you're making a singleton for "easy referencing" ?
What does singleton means tho
it's a design pattern that makes it so only a single object of that type is active and allows a static reference to that object. It is not necessary here
You can use a scriptable object . . .
the one of the only good brackeys tutorials is on Scriptable Objects
I'd recommend watching it
SO is perfect for what you want. they are essentially data containers
It's the only way to avoid placing a script on a game object . . . unless you create a script to put on a game object, turn it into a prefab, and reference the prefab in a variable from a script on a scene object, but that's a workaround . . .
Actually i want smth like
Creating a script
Writing down some variables
And then accesing them anytime and everywhere i want
Like a global variables
Scriptable Object
Kk
Oh also
Another question
Can i get classes and methods from scriptable object?
methods yes, i am unsure abour classes