public override ActionResult DoAction()
        {
            GameObject     go   = new GameObject();
            PolyShape      poly = go.AddComponent <PolyShape>();
            ProBuilderMesh pb   = poly.gameObject.AddComponent <ProBuilderMesh>();

            pb.CreateShapeFromPolygon(poly.m_Points, poly.extrude, poly.flipNormals);
            EditorUtility.InitObject(pb);

            // Special case - we don't want to reset the grid pivot because we rely on it to set the active plane for
            // interaction, regardless of whether snapping is enabled or not.
            if (ProGridsInterface.SnapEnabled() || ProGridsInterface.GridVisible())
            {
                Vector3 pivot;
                if (ProGridsInterface.GetPivot(out pivot))
                {
                    go.transform.position = pivot;
                }
            }
            MeshSelection.SetSelection(go);
            UndoUtility.RegisterCreatedObjectUndo(go, "Create Poly Shape");
            poly.polyEditMode = PolyShape.PolyEditMode.Path;


            return(new ActionResult(ActionResult.Status.Success, "Create Poly Shape"));
        }
        protected override ActionResult PerformActionImplementation()
        {
            if (!CanCreateNewPolyShape())
            {
                return(new ActionResult(ActionResult.Status.Canceled, "Canceled Create Poly Shape"));
            }

            GameObject go = new GameObject("PolyShape");

            UndoUtility.RegisterCreatedObjectUndo(go, "Create Poly Shape");
            PolyShape      poly = Undo.AddComponent <PolyShape>(go);
            ProBuilderMesh pb   = Undo.AddComponent <ProBuilderMesh>(go);

            pb.CreateShapeFromPolygon(poly.m_Points, poly.extrude, poly.flipNormals);
            EditorUtility.InitObject(pb);

            // Special case - we don't want to reset the grid pivot because we rely on it to set the active plane for
            // interaction, regardless of whether snapping is enabled or not.
            if (ProGridsInterface.SnapEnabled() || ProGridsInterface.GridVisible())
            {
                Vector3 pivot;
                if (ProGridsInterface.GetPivot(out pivot))
                {
                    go.transform.position = pivot;
                }
            }
            MeshSelection.SetSelection(go);
            poly.polyEditMode = PolyShape.PolyEditMode.Path;

            ProBuilderEditor.selectMode = SelectMode.Object;

            m_Tool = ScriptableObject.CreateInstance <PolyShapeTool>();
            ((PolyShapeTool)m_Tool).polygon = poly;
            ToolManager.SetActiveTool(m_Tool);

            Undo.RegisterCreatedObjectUndo(m_Tool, "Open PolyShape Tool");

            MenuAction.onPerformAction         += ActionPerformed;
            ToolManager.activeToolChanging     += LeaveTool;
            ProBuilderEditor.selectModeChanged += OnSelectModeChanged;

            MeshSelection.objectSelectionChanged += OnObjectSelectionChanged;

            return(new ActionResult(ActionResult.Status.Success, "Create Poly Shape"));
        }
    static RegisterDebugDefines()
    {
        if (EditorPrefs.GetBool("DeveloperMode", false))
        {
            ScriptingSymbolManager.AddScriptingDefine("DEVELOPER_MODE");
        }
        else
        {
            ScriptingSymbolManager.RemoveScriptingDefine("DEVELOPER_MODE");
        }

        var progridsType = ProGridsInterface.GetProGridsType();

        if (progridsType != null)
        {
            ScriptingSymbolManager.AddScriptingDefine("PROGRIDS_ENABLED");
        }
        else
        {
            ScriptingSymbolManager.RemoveScriptingDefine("PROGRIDS_ENABLED");
        }
    }
 public static void UnsubscribeToolbarEvent()
 {
     Assert.IsNotNull(ProGridsInterface.GetProGridsType().GetMethod("RemoveToolbarEventSubscriber", k_BindingFlagsAll));
 }
 public static void OnHandleMove()
 {
     Assert.IsNotNull(ProGridsInterface.GetProGridsType().GetMethod("OnHandleMove", k_BindingFlagsAll));
 }
 public static void UnsubscribePushToGridEvent()
 {
     Assert.IsNotNull(ProGridsInterface.GetProGridsType().GetMethod("RemovePushToGridListener", k_BindingFlagsAll));
 }
 public static void GetPivot()
 {
     Assert.IsNotNull(ProGridsInterface.GetProGridsType().GetMethod("GetPivot", k_BindingFlagsAll));
 }
 public static void SnapValue()
 {
     Assert.IsNotNull(ProGridsInterface.GetProGridsType().GetMethod("SnapValue", k_BindingFlagsAll));
 }
 public static void UseAxisConstraints()
 {
     Assert.IsNotNull(ProGridsInterface.GetProGridsType().GetMethod("UseAxisConstraints", k_BindingFlagsAll));
 }
 public static void SceneToolbarIsExtended()
 {
     Assert.IsNotNull(ProGridsInterface.GetProGridsType().GetMethod("SceneToolbarIsExtended", k_BindingFlagsAll));
 }
 public static void ProGridsActive()
 {
     Assert.IsNotNull(ProGridsInterface.GetProGridsType().GetMethod("SceneToolbarActive", k_BindingFlagsAll));
 }
 public static void GetProGridsType()
 {
     Assert.IsNotNull(ProGridsInterface.GetProGridsType());
 }