﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif

public class RecalculateMesh : MonoBehaviour {
    // Start is called before the first frame update
	void Start () {
		#if UNITY_EDITOR
		if (EditorApplication.isPlayingOrWillChangePlaymode) {
			EditorApplication.ExecuteMenuItem ("Tools/Polybrush/Auto Apply to Mesh");
		} else {
			EditorApplication.ExecuteMenuItem ("Tools/Polybrush/Auto Apply to Mesh");
		}
		#endif
		Mesh mesh = GetComponent<MeshFilter> ().mesh;
		mesh.RecalculateBounds ();
    }
}
