Пример #1
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        EditorGUI.BeginChangeCheck();

        // Check current path
        CheckSelected();

        //if (creator.currentSection == null)
        //{
        //    return;
        //}

        if (GUILayout.Button("Create new"))
        {
            Undo.RecordObject(creator, "Create new");
            creator.CreateNewPathSection();
        }
        if (GUILayout.Button("Show selected"))
        {
            for (var i = 0; i < PathSections.Count(); i++)
            {
                if (PathSections[i].isSelected)
                {
                    Debug.Log(i);
                    Debug.Log(creator.currentSection.GetType());
                }
            }
        }
        if (GUILayout.Button("Show selectedIdx"))
        {
            Debug.Log(numberOfSelectedSections);
        }

        //bool isClosed = GUILayout.Toggle(Path.IsClosed, "Closed");
        //if (isClosed != Path.IsClosed)
        //{
        //    Undo.RecordObject(creator, "Toggle closed");
        //    Path.IsClosed = isClosed;
        //}

        //bool autoSetControlPoints = GUILayout.Toggle(Path.AutoSetControlPoints, "Auto Set Control Points");
        //if (autoSetControlPoints != Path.AutoSetControlPoints)
        //{
        //    Undo.RecordObject(creator, "Toggle auto set controls");
        //    Path.AutoSetControlPoints = autoSetControlPoints;
        //}

        if (EditorGUI.EndChangeCheck())
        {
            SceneView.RepaintAll();
        }
    }