c# - How to get array of child objects contained in a GameObject -
i have gameobject
in unity supposed serve container definitions.
i'd access object , retrieve def
class instances (every object there instance of def
general class).
so, if have gameobject
instance, how can retrieve objects instances of specific class?
you can use gameobject.getcomponents<def>();
retrieve components of def
type in gameobject
.
more info in unity docs http://docs.unity3d.com/scriptreference/gameobject.getcomponents.html
Comments
Post a Comment