Exemple #1
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        labelStyle.normal.textColor = netDisplaySettings.guiStyle.normal.textColor;

        GUILayout.Space(20);

        if (GUILayout.Button("Stick Nodes to Ground"))
        {
            StickNodesToGround();
        }

        if (GUILayout.Button("Recalculate Vertices"))
        {
            for (int i = 0; i < creator.NStretches; i++)
            {
                Stretch st = creator.GetStretch(i);
                st.OnPathModified();
            }
        }

        if (GUILayout.Button("Reassign Nodes"))
        {
            for (int i = 0; i < creator.NNodes; i++)
            {
                Node n = creator.GetNode(i);
                n.id             = i;
                n.transform.name = "NODE_" + i;
            }
        }

        if (GUILayout.Button("Print curvature percentages"))
        {
            for (int i = 0; i < creator.NStretches; i++)
            {
                Stretch st = creator.GetStretch(i);
                Debug.Log("Stretch: " + st.Name + ": " + PathCreation.Utility.CubicBezierUtility.AproximateAmountOfCurvature(st.GetPoints()));
            }
        }

        GUILayout.Space(20);

        if (GUILayout.Button("Load from xml file"))
        {
            creator.LoadFromXml();
        }
        if (GUILayout.Button("Save to xml file"))
        {
            creator.SaveToXml();
        }

        GUILayout.Space(20);

        if (selectedNode != null)
        {
        }

        DrawNetDisplaySettingsInspector();
    }