#Unity Object Conventions

1 messages · Page 1 of 1 (latest)

oak beacon
#

I want a list of all MyObjects that are in the scene. Should I store them in a GameObject list, and just do GameObject.GetComponent<MyObject>() whenever I want to access the class, or should I make a MyObject list and add the classes themselves (not the GameObjects) to the list?

#

I'm not used to working with GameObjects, so I want to make sure I'm doing the conventionally correct things

drifting surge
#

just reference the component directly, no need to go through the game objects

grim sorrel
#

For what purpose would you want a list of every script in the scene

oak beacon
#

Need to keep track of the pillars in a list to avoid having to call FindObjectsOfType every frame

grim sorrel
#

you can make a list of pillars sure

#

Totally standard

#

Just not every single instance of T in the entire scene

oak beacon
#

What is T?

grim sorrel
#

its like

#

A symbol to signify Generic

#

just figure of speach, for the most part here

#

MyScriptA
MyScriptB

#

all under the umbrella of T. (scripts)

#

im not explaining this very wwell