using UnityEngine;
using System.Collections;

public class MeshSpikes : MonoBehaviour {

	// Use this for initialization
	void Start () {
		Mesh m = GetComponent<MeshFilter>().sharedMesh;
		Vector3[] vert = m.vertices;
		Vector3[] norm = m.normals;

		for (int i = 0; i < vert.Length; i++)
		{
			int index = (int)(Random.value * (vert.Length - 1));
			vert[index] += norm[index] * 0.5f;
		}

		GetComponent<MeshFilter>().mesh.vertices = vert;
	}
}
