Custom editor is not applying the settings.

I made a script that round the points of the polygon collider 2D:

using UnityEngine;
using UnityEditor;
using System.Collections;

[CustomEditor(typeof(PolygonPoints))]
public class PolyColliderPointAling : Editor 
{
	PolygonPoints polygonPoints;

	public override void OnInspectorGUI()
	{
		serializedObject.Update();

		if(GUILayout.Button("Run!"))
		{
			polygonPoints = target as PolygonPoints;

			PolygonCollider2D[] colliders = polygonPoints.gameObject.GetComponents<PolygonCollider2D>();

			for(int y = 0; y < colliders.Length; y++)
			{
				Vector2[] points = colliders[y].points;
				Debug.Log(points.Length);
				
				for(int i = 0; i < points.Length; i++)
				{
					Vector2 pointPosition = new Vector2(Mathf.Round(points_.x), Mathf.Round(points*.y));*_

_ points = pointPosition;
Debug.Log(points*.ToString(“F5”));
}
}
EditorUtility.SetDirty(polygonPoints);
}*_

* serializedObject.ApplyModifiedProperties();*
* }*
}
The PolygonPoints script:
using UnityEngine;
using System.Collections;

public class PolygonPoints : MonoBehaviour {

* PolygonCollider2D[] colliders;*

* void Start()*
* {*
* colliders = gameObject.GetComponents();*
* for(int y = 0; y < colliders.Length; y++)*
* {*
* Vector2[] points = colliders[y].points;*
* Debug.Log(points.Length + “pontos.”);*

* for(int i = 0; i < points.Length; i++)*
* {*
_ Debug.Log(points*.ToString(“F5”));
}
}
}
}*

When I hit the “run” button the console shows that the points have been rounded. But when I hit play I lose all changes and I don’t know why. How can I apply the changes that I have made ?_

These two:

Vector2[] points = colliders[y].points;
...
points *= pointPosition;*

will not modify colliders[y].points. Arrays are copies and Vector2s are structs. Your Debug.Log(points*.ToString("F5")); prints your local array, not the .points array from the collider.*
You have to colliders[y].points = points in the end.