Created
April 20, 2016 18:26
-
-
Save MiketoString/7c3ac553c7a8122098f9c636b9e4a5a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
[ExecuteInEditMode] | |
public class UnityUICounts : MonoBehaviour { | |
public int TotalRectTransforms = 0; | |
public int ImageObjectCount = 0; | |
public int TextObjectCount = 0; | |
public int ButtonObjectCount = 0; | |
#if UNITY_EDITOR | |
void Update () { | |
ImageObjectCount = GetComponentsInChildren<UnityEngine.UI.Image>( true ).Length; | |
TextObjectCount = GetComponentsInChildren<UnityEngine.UI.Text>( true ).Length; | |
ButtonObjectCount = GetComponentsInChildren<UnityEngine.UI.Button>( true ).Length; | |
TotalRectTransforms = GetComponentsInChildren<RectTransform>( true ).Length; | |
} | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment