public override void OnInspectorGUI() { SetRefs(); if (GUILayout.Button("Generate Mesh")) { m.GenerateMesh(); } DrawDefaultInspector(); }
void OnSceneGUI() { SetRefs(); handleTransform = curve.transform; handleRotation = Tools.pivotRotation == PivotRotation.Local ? handleTransform.rotation : Quaternion.identity; ShowPoints(); //Handles.DrawBezier(curve.points[0], curve.points[1], curve.points[2], curve.points[3], Color.blue, null, 2f); curve.curvePoints.Clear(); for (int i = 0; i < curve.Splines; i++) { DrawBezier(i); } if (!curve.Parent.manuallyUpdateMesh) { if (Time.realtimeSinceStartup - timeSinceLastGen > .1f) { timeSinceLastGen = Time.realtimeSinceStartup; //Debug.Log("gen"); pMesh.GenerateMesh(); } } }