csharp/365082218/meteor_original_ios/Assets/ThirdParty/NGUI/Scripts/Editor/UIDrawCallInspector.cs

UIDrawCallInspector.cs
//----------------------------------------------
//            NGUI: Next-Gen UI kit
// Copyright © 2011-2013 Tasharen Entertainment
//----------------------------------------------

using UnityEngine;
using UnityEditor;

/// 
/// Inspector clast used to view UIDrawCalls.
/// 

[CustomEditor(typeof(UIDrawCall))]
public clast UIDrawCallInspector : Editor
{
	/// 
	/// Draw the inspector widget.
	/// 

	public override void OnInspectorGUI ()
	{
		if (Event.current.type == EventType.Repaint || Event.current.type == EventType.Layout)
		{
			UIDrawCall dc = target as UIDrawCall;

			UIPanel[] panels = (UIPanel[])Component.FindObjectsOfType(typeof(UIPanel));

			foreach (UIPanel p in panels)
			{
				if (p.drawCalls.Contains(dc))
				{
					EditorGUILayout.LabelField("Owner Panel", NGUITools.GetHierarchy(p.gameObject));
					EditorGUILayout.LabelField("Triangles", dc.triangles.ToString());
					return;
				}
			}
			if (Event.current.type == EventType.Repaint) Debug.LogWarning("Orphaned UIDrawCall detected!\nUse [Selection -> Force Delete] to get rid of it.");
		}
	}
}