示例#1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        mesh = target as CustomHeart;

        if (GUILayout.Button("Clear Selected Vertices"))
        {
            Debug.Log("Editor Reset");
            assignIndex   = 0;
            selectedIndex = -1;
            mesh.ClearAllData();
        }

        if (mesh.editType.ToString() != "None" && !Application.isPlaying)
        {
            if (GUILayout.Button("Show Normals"))
            {
                mesh.ShowNormals();
            }
        }
    }
示例#2
0
    void OnSceneGUI()
    {
        mesh            = target as CustomHeart;
        handleTransform = mesh.transform;
        handleRotation  = Tools.pivotRotation == PivotRotation.Local ? handleTransform.rotation : Quaternion.identity;

        if (mesh.oVertices == null)
        {
            mesh.Init();
        }

        // Add Points
        if (mesh.editType.ToString() == "AddIndices")
        {
            for (int i = 0; i < mesh.oVertices.Length; i++)
            {
                ShowHandle(i);
            }
        } // Remove Points
        else if (mesh.editType.ToString() == "RemoveIndices")
        {
            for (int i = 0; i < mesh.oVertices.Length; i++)
            {
                ShowSelected(i);
            }
        }

        // Show/ Hide Transform Tool..
        if (mesh.showTransformHandle)
        {
            Tools.current = Tool.Move;
        }
        else
        {
            Tools.current = Tool.None;
        }
    }