exdev / ex2d-dev

2D framework and pipeline for Unity3D
ex-dev.com/ex2d
GNU General Public License v3.0
6 stars 3 forks source link

当 exSpriteFont.text 没有文字的时候,会发生 GetAABoundingRect 数组越界的问题 #12

Closed jwu closed 11 years ago

jwu commented 11 years ago

Call Stack 如下:

IndexOutOfRangeException: Array index is out of range.
exGeometryUtility.GetAABoundingRect (UnityEngine.Vector3[] _vertices) (at Assets/ex2D/Core/Utilities/exGeometryUtility.cs:86)
exSpriteBase.GetAABoundingRect () (at Assets/ex2D/Core/Components/exSpriteBase.cs:472)
exSceneEditor.MapBoundingRect (Rect _rect, .exSpriteBase _node) (at Assets/ex2D/Editor/exSceneEditor.cs:1173)
exSceneEditor.DoCulling (Rect _rect) (at Assets/ex2D/Editor/exSceneEditor.cs:1206)
exSceneEditor.SceneViewField (Rect _rect) (at Assets/ex2D/Editor/exSceneEditor.cs:567)
exSceneEditor.Layout_SceneViewField (Int32 _width, Int32 _height) (at Assets/ex2D/Editor/exSceneEditor.cs:533)
exSceneEditor.OnGUI () (at Assets/ex2D/Editor/exSceneEditor.cs:194)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

应该在 GetAABoundingRect 里加上保护。