Transform.childCount 子物体数


var childCount : int

Description描述

The number of children the Transform has.

变换的子物体数量。

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {    public void Awake() {   print(transform.childCount);    }}
// print the number of child objects//打印物体的子物体数print(transform.childCount);


,