public void Setup()
 {
     CloseWindows <ProBuilderEditor>();
     EditorWindow.GetWindow <ProBuilderEditor>();
     Assert.That(ProBuilderEditor.instance, Is.Not.Null);
     m_PBMesh = ShapeFactory.Instantiate(typeof(Cube));
     ProBuilderEditor.selectMode = SelectMode.Vertex;
     ProBuilderEditor.SyncEditorToolSelectMode();
     Assume.That(ProBuilderEditor.selectMode, Is.EqualTo(SelectMode.Vertex));
     Assume.That(typeof(VertexManipulationTool).IsAssignableFrom(ToolManager.activeToolType));
 }
Exemple #2
0
    public void SetToolKeepsContext()
    {
        var editor = EditorWindow.GetWindow <ProBuilderEditor>();

        Assume.That(editor, Is.Not.Null);
        ProBuilderEditor.selectMode = SelectMode.Face;
        Assume.That(ProBuilderEditor.selectMode, Is.EqualTo(SelectMode.Face));
        Assume.That(ToolManager.activeToolType, Is.EqualTo(typeof(ProbuilderMoveTool)));
        Tools.current = Tool.Rotate;
        ProBuilderEditor.SyncEditorToolSelectMode();
        Assert.That(ToolManager.activeToolType, Is.EqualTo(typeof(ProbuilderRotateTool)));
    }
Exemple #3
0
    public void SetSelectModeSetsTool()
    {
        var editor = EditorWindow.GetWindow <ProBuilderEditor>();

        Assume.That(editor, Is.Not.Null);
        ProBuilderEditor.selectMode = SelectMode.Object;
        Assume.That(ProBuilderEditor.selectMode, Is.EqualTo(SelectMode.Object));
        Tools.current = Tool.Move;

        ProBuilderEditor.selectMode = SelectMode.Face;
        // this is here to avoid race conditions when testing
        ProBuilderEditor.SyncEditorToolSelectMode();

        Assert.That(ToolManager.activeToolType, Is.EqualTo(typeof(ProbuilderMoveTool)));
    }