Esempio n. 1
0
    public override void OnInspectorGUI()
    {
        //string[] strings =new [] { "foo", "foobar" };
        //EditorGUILayout.Popup(0, strings);

        if (GUILayout.Button("Bake", GUILayout.Height(40)))
        {
            _grid.Bake();
        }

        _grid = (qpGrid)target;

        _grid.DrawInEditor = (GUILayout.Toggle(_grid.DrawInEditor, "Draw In Editor"));
        GUIStyle style = new GUIStyle();

        style.fixedWidth      = 200;
        style.contentOffset   = new Vector2(300, 0);
        _grid.startCoordinate = EditorGUILayout.Vector2Field("Start point of Grid", _grid.startCoordinate);
        _grid.endCoordinate   = EditorGUILayout.Vector2Field("End point of Grid", _grid.endCoordinate);

        GUILayout.Label("Up Direction");
        _grid.UpDirection = (qpGrid.Axis)EditorGUILayout.EnumPopup(_grid.UpDirection);
        _showHighestPoint();
        _showLowestPoint();
        _showNodeSpread();
        _showDisallowedTags();
        _showIgnoreTags();
        if (GUI.changed)
        {
            EditorUtility.SetDirty(target);
        }
    }
Esempio n. 2
0
    public override void OnInspectorGUI()
    {
        //string[] strings =new [] { "foo", "foobar" };
        //EditorGUILayout.Popup(0, strings);

        if (GUILayout.Button("Bake", GUILayout.Height(40)))
        {
            _grid.Bake();
        }

        _grid = (qpGrid)target;

        _grid.DrawInEditor = (GUILayout.Toggle(_grid.DrawInEditor, "Draw In Editor"));
        GUIStyle style = new GUIStyle();

        style.fixedWidth      = 200;
        style.contentOffset   = new Vector2(300, 0);
        _grid.startCoordinate = EditorGUILayout.Vector2Field("Start point of Grid", _grid.startCoordinate);
        _grid.endCoordinate   = EditorGUILayout.Vector2Field("End point of Grid", _grid.endCoordinate);

        GUILayout.Label("Up Direction");
        _grid.UpDirection         = (qpGrid.Axis)EditorGUILayout.EnumPopup(_grid.UpDirection);
        _grid.UpRaycastStart      = EditorGUILayout.FloatField("Highest Point", _grid.UpRaycastStart);
        _grid.UpRayCastEnd        = EditorGUILayout.FloatField("Lowest Point", _grid.UpRayCastEnd);
        _grid.spread              = EditorGUILayout.FloatField("Node Spread", _grid.spread);
        _grid.MaxNodeDistance     = EditorGUILayout.FloatField("Max Node Connection Distance", _grid.MaxNodeDistance);
        _grid.NodeConnectionDepth = EditorGUILayout.IntField("Node Connection Depth", _grid.NodeConnectionDepth);

        _grid.RaycastBetweenNodes = (GUILayout.Toggle(_grid.RaycastBetweenNodes, "Raycast between nodes before connecting them"));
        _showDisallowedTags();
        _showIgnoreTags();
        if (GUI.changed)
        {
            EditorUtility.SetDirty(target);
        }
    }