Example #1
0
    void CreateWaypoint(Vector3 pos)
    {
        var waypoint = Instantiate(waypointPrefab, pos, Quaternion.identity);

        waypoint.transform.parent = GameObject.Find("Waypoints").transform;
        Waypoint.AddWaypoint(waypoint.transform);
    }
    public override void OnInspectorGUI()
    {
        Waypoint _waypoint = (Waypoint)target;

        if (GUILayout.Button("Add Another Waypoint"))
        {
            _waypoint.AddWaypoint();
        }

        // Save the changes back to the object
        EditorUtility.SetDirty(target);
    }
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        Waypoint waypoint = target as Waypoint;

        if (GUILayout.Button("Add Waypoint"))
        {
            Undo.RecordObject(waypoint, "Add Waypoint");
            waypoint.AddWaypoint();
            EditorUtility.SetDirty(waypoint);
        }
    }