Skip to content

Instantly share code, notes, and snippets.

@akbiggs
Created December 9, 2015 18:30
Show Gist options
  • Save akbiggs/963ca5fae34479c204f3 to your computer and use it in GitHub Desktop.
Save akbiggs/963ca5fae34479c204f3 to your computer and use it in GitHub Desktop.
GameObject Find Public Inspector Fields
using UnityEngine;
using UnityEngine.UI;
public class ShowNumberOfCanvasChildren : MonoBehaviour
{
public GameObject Canvas;
public 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