public Vector3 TOP(object[] args)
{
Vector3 outValue = Vector3.zero;
if (args [0] is GameObject) {
GameObject obj = ((GameObject)args[0]);
Renderer[] renderers = obj.GetComponentsInChildren<Renderer>();
Bounds bounds = new Bounds();
foreach (Renderer renderer in renderers) {
if (renderer.bounds.max.y > bounds.max.y) {
bounds = renderer.bounds;
}
}
Debug.Log("top: " + bounds.max.y);
//Debug.Log (bounds.ToString());
//Debug.Log (obj.transform.position.ToString());
outValue = new Vector3(bounds.center.x,bounds.max.y,bounds.center.z);
}
return outValue;
}