Ejemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        mesh = target as MeshStudy;
        if (GUILayout.Button("Reset"))
        {
            mesh.Reset();
        }

        if (mesh.isCloned)
        {
            if (GUILayout.Button("Test Edit"))
            {
                mesh.EditMesh();
            }
        }
    }
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        mesh = target as MeshStudy;

        if (GUILayout.Button("Reset")) // 1. Code draws a Reset button in Inspector
        {
            mesh.Reset();              // 2. When prssed, calls Reset() function in MeshStudy.cs
        }
        // For testing Reset function
        if (mesh.isCloned)
        {
            if (GUILayout.Button("Test Edit"))
            {
                mesh.EditMesh();
            }
        }
    }
Ejemplo n.º 3
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        mesh = target as MeshStudy;

        if (GUILayout.Button("Reset")) //1
        {
            mesh.Reset();              //2
        }

        //MODIFIED: an error was showing up, so I had to add the exceptiong for a SkinnedMeshRenderer component.
        // For testing Reset function
        //if (mesh.isCloned)
        //{
        //    if (GUILayout.Button("Test Edit"))
        //    {
        //        mesh.EditMesh();
        //    }
        //}
    }
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        mesh = target as MeshStudy;
        if (GUILayout.Button("Reset")) //1
        {
            mesh.Reset();              //2
        }

        // For testing Reset function
        if (mesh.isCloned)
        {
            if (GUILayout.Button("Test Edit"))
            {
                mesh = target as MeshStudy;
                Debug.Log("Custom editor is running");
                mesh.EditMesh();
            }
        }
    }