Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity put children in list

List<Transform> children = new List<Transform>(transform.GetComponentsInChildren<Transform>());
//!!!!DISCLAMER!!!! This will also include the parent object for whatever reason.
//Heres a less elegant solution that wont include parent:
List<Transform> children = new List<Transform>();
foreach (Transform tr in transform) children.Add(tr);
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity how to change the text on a button 
Csharp :: blazor alert 
Csharp :: unity get rigidbody 
Csharp :: making a list of chars in c# 
Csharp :: get desktop path c# 
Csharp :: unity object to mouse position 
Csharp :: blazor button onclick parameter 
Csharp :: emboss button in android app 
Csharp :: unity read from text file 
Csharp :: how to run c# code in visual studio code terminal 
Csharp :: c# implicit operator 
Csharp :: c# string to enum 
Csharp :: debug.log unity 
Csharp :: Editor log location unity 
Csharp :: unity detect any key 
Csharp :: how to freeze x and y position in rb2d with code unity 
Csharp :: c# odd even median 
Csharp :: how to check if textbox is empty in c# 
Csharp :: start command line from c# 
Csharp :: c# pick a random item from array 
Csharp :: c# relative path to project folder 
Csharp :: get query string parameter from string value c# 
Csharp :: read input c# 
Csharp :: weighted random c# 
Csharp :: How to get an array of months in c# 
Csharp :: unity on inspector change 
Csharp :: c# linq select from object list 
Csharp :: how set function when props update in vue 
Csharp :: git find commits by message 
Csharp :: how to do time.deltatime in c# 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =