Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Unity search all chidren of parent object

using System.Collections.Generic;

private List<GameObject> listOfChildren;
private void GetChildRecursive(GameObject obj){
    if (null == obj)
        return;

    foreach (Transform child in obj.transform){
        if (null == child)
            continue;
        //child.gameobject contains the current child you can do whatever you want like add it to an array
        listOfChildren.Add(child.gameObject);
        GetChildRecursive(child.gameObject);
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: what is the default value for an enum c# 
Csharp :: Initalize C# project in VS Code 
Csharp :: unity button hover 
Csharp :: unfreeze position in unity 
Csharp :: .net check connection 
Csharp :: c# asqueryable select 
Csharp :: EntityFramework: using tables in different scemas 
Csharp :: touch screen to world point 
Csharp :: Implementing Banner Ads Unity 
Csharp :: return last row if all other condition fails in linq c# 
Csharp :: material.icons for wpf 
Csharp :: encode < for xml 
Csharp :: c# check if list is empty 
Csharp :: visual studio private field underscore 
Csharp :: C:UsersSherryDocumentssdata.dta 
Csharp :: what is difference between int.Parse and toint32 in c# 
Csharp :: in model add to give drop down message 
Csharp :: tee into file 
Csharp :: how to make continuous progress bar 
Csharp :: convert bool to uint in solidity 
Csharp :: getcomponent 
Csharp :: return value of a mocked value will be as the input c# 
Csharp :: unity3d spin wheel 
Csharp :: how to create advance search with parameter in asp.net mvc 
Csharp :: how to trigger event when a com device is connected in c# 
Csharp :: embergene 
Csharp :: how to if i enter 1 go to this program C# 
Csharp :: windows forms tablelayoutpanel scroll 
Csharp :: convert string to boolean c# 
Csharp :: dotnet core webapp 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =