public override void OnInspectorGUI() { //base.OnInspectorGUI (); EditorGUIUtility.LookLikeInspector(); layoutHelper = target as LayoutHelper; EditorGUILayout.PrefixLabel("Transforms:"); layoutHelper.Transforms = ArrayEditor.DisplayArrayEditor <Transform> (layoutHelper.Transforms, EditTransform); DrawSeparator(); EditorGUILayout.PrefixLabel("Layouts:"); layoutHelper.Layouts = ArrayEditor.DisplayArrayEditor <LayoutHelper.Layout> (layoutHelper.Layouts, EditLayout); }
public int DeformFromPoint(Vector2 point, int height) { Mesh currentPlane = gameObject.GetComponent <MeshFilter>().mesh; Vector3[] vertices = currentPlane.vertices; Vector3[,] sortedVertices = ArrayEditor.ToToDem <Vector3>(vertices); for (int x = -(height / 2); x <= (height / 2); x++) { for (int y = -(height / 2); y <= (height / 2); y++) { try { sortedVertices[x, y].y = Mathf.Abs(point.x - x); } catch { } } } currentPlane.vertices = ArrayEditor.ToOneDem <Vector3>(sortedVertices); currentPlane.RecalculateBounds(); return(1); }
public void ArrayEditor_GetPaintValueSupported_Invoke_ReturnsFalse(ITypeDescriptorContext context) { var editor = new ArrayEditor(null); Assert.False(editor.GetPaintValueSupported(context)); }
public void ArrayEditor_GetEditStyle_Invoke_ReturnsModal(ITypeDescriptorContext context) { var editor = new ArrayEditor(null); Assert.Equal(UITypeEditorEditStyle.Modal, editor.GetEditStyle(context)); }