Skip to content

Instantly share code, notes, and snippets.

@akbiggs
Last active April 27, 2016 18:11
Show Gist options
  • Save akbiggs/7b1fdd4022c1a0ce7876 to your computer and use it in GitHub Desktop.
Save akbiggs/7b1fdd4022c1a0ce7876 to your computer and use it in GitHub Desktop.
using UnityEngine;
using UnityEngine.UI;
public class ShowNumberOfCanvasChildren : MonoBehaviour
{
[SerializeField] private GameObject _canvas;
[SerializeField] private Text _numChildrenText;
private void Update()
{
_numChildrenText.text = "Canvas child count: " + _canvas.transform.childCount;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment