public override void OnInspectorGUI()
    {
        NavMeshSurface obj = (NavMeshSurface)target;

        serializedObject.Update();
        AgentTypePopup("Agent Type", agentID);

        GUI.enabled = isOver.boolValue;
        if (GUILayout.Button(hideFlag.boolValue ? "Hide" : "Display"))
        {
            obj.SwitchStateDisplayNavMesh();
        }
        serializedObject.ApplyModifiedProperties();
    }
Beispiel #2
0
    public override void OnInspectorGUI()
    {
        NavMeshSurface obj = (NavMeshSurface)target;

        serializedObject.Update();
        AgentTypePopup("Agent Type", agentID);

        GUI.enabled = isOver.boolValue; //Only let the user click the button if the NavMesh is finished.
        GUIContent text = new GUIContent(hideFlag.boolValue ? "Hide" : "Display", "Toggle the visibility of the NavMesh.");

        if (GUILayout.Button(text))
        {
            obj.SwitchStateDisplayNavMesh();        //Switch the setting to whatever it wasn't before.
        }
        serializedObject.ApplyModifiedProperties(); //Applies everything we just changed.
    }
    public override void OnInspectorGUI()
    {
        NavMeshSurface obj = (NavMeshSurface)target;

        serializedObject.Update();

        GUIContent zedManagerLink = new GUIContent("ZED Rig", "ZEDManager (Rig) to link to NavMesh generation");

        obj.zedManagerSpatialMapping = (ZEDManager)EditorGUILayout.ObjectField(zedManagerLink, obj.zedManagerSpatialMapping, typeof(ZEDManager), true);

        AgentTypePopup("Agent Type", agentID);

        GUI.enabled = isOver.boolValue; //Only let the user click the button if the NavMesh is finished.
        GUIContent text = new GUIContent(hideFlag.boolValue ? "Hide" : "Display", "Toggle the visibility of the NavMesh.");

        if (GUILayout.Button(text))
        {
            obj.SwitchStateDisplayNavMesh();        //Switch the setting to whatever it wasn't before.
        }
        serializedObject.ApplyModifiedProperties(); //Applies everything we just changed.
    }