public void RotateBone_SingleBoneSelected_SetsLocalRotation()
        {
            m_SelectedBones.Add(1);

            m_View.IsActionTriggering(BindPoseAction.RotateBone).Returns(true);
            m_View.IsActionFinishing(BindPoseAction.RotateBone).Returns(true);

            Vector2 lookAtPosition;

            m_View.DoRotateBone(out lookAtPosition).Returns(x =>
            {
                x[0] = Vector2.down * 10f;
                return(true);
            });

            m_BindPoseController.DoBoneGUI();

            AssertQuaternion(new Quaternion(0f, 0f, 0.87f, -0.48f), m_SpriteMeshData.bones[1].localRotation);
            m_UndoObject.Received(1).RegisterCompleteObjectUndo(Arg.Any <string>());
            m_UndoObject.Received(1).RevertAllInCurrentGroup();
        }
Example #2
0
        public void CreateVertex_WithMousePositionInsideFrame_CreatesVertexFromMousePosition()
        {
            m_MousePosition = new Vector2(10f, 7f);

            m_View.DoCreateVertex().Returns(true);

            m_SpriteMeshController.OnGUI();

            Assert.AreEqual(1, m_SpriteMeshData.vertices.Count, "Incorrect number of vertices");
            Assert.AreEqual(m_MousePosition, m_SpriteMeshData.vertices[0].position, "Vertex position is incorrect");
            m_UndoObject.Received().RegisterCompleteObjectUndo(Arg.Any <string>());
            m_Triangulator.Received().Triangulate(Arg.Any <IList <Vector2> >(), Arg.Any <IList <Edge> >(), Arg.Any <IList <int> >());
        }