MeshCreator.Reset C# (CSharp) Method

Reset() private method

private Reset ( ) : bool
return bool
    private bool Reset()
    {
        if(verts == null || verts.Count == 0 || EditorUtility.DisplayDialog("Reset points", "Are you sure? This operation will reset points.", "Yes", "Cancel")) {
            verts = new List<Vertex>();
            segments = new List<Segment>();
            holes = new List<Vector2>();

            meshDirty = true;
            generatedMesh = null;
            #if UNITY_EDITOR
            EditorUtility.SetDirty(this);
            if (SceneView.currentDrawingSceneView != null) {
                SceneView.currentDrawingSceneView.Repaint();
            }
            #endif
            return true;
        }
        return false;
    }

Usage Example

Ejemplo n.º 1
0
    public void ClearAllPoint()
    {
        meshCreate.Reset();

        foreach (var pobject in points)
        {
            Destroy(pobject.gameObject);
        }

        points.Clear();
    }
All Usage Examples Of MeshCreator::Reset