public Transform3DComponentPropertiesEditorViewModel(Transform3DComponentModel componentModel) : base(componentModel)
        {
            _translation = CreateProperty(nameof(Translation), componentModel.Translation);
            _rotation    = CreateProperty(nameof(Rotation), componentModel.Rotation);
            _scale       = CreateProperty(nameof(Scale), componentModel.Scale);

            _translation.Subscribe(v => componentModel.Translation = v);
            _rotation.Subscribe(v => componentModel.Rotation       = v);
            _scale.Subscribe(v => componentModel.Scale             = v);
        }
Esempio n. 2
0
        public void Create_ShouldCreateTransform3DComponentPropertiesEditorViewModel_GivenTransform3DComponentModel()
        {
            // Arrange
            var componentModel = new Transform3DComponentModel(new Engine.Core.Components.Transform3DComponent());

            // Act
            var viewModel = _componentPropertiesEditorViewModelFactory.Create(componentModel);

            // Assert
            Assert.That(viewModel, Is.TypeOf <Transform3DComponentPropertiesEditorViewModel>());
        }
 public void SetUp()
 {
     // Arrange
     _transformComponent = new Transform3DComponent
     {
         Translation = new Vector3(1, 2, 3),
         Rotation    = new Vector3(4, 5, 6),
         Scale       = new Vector3(7, 8, 9)
     };
     _transformComponentModel = new Transform3DComponentModel(_transformComponent);
 }
        public void SetUp()
        {
            // Arrange
            var transformComponent = new Engine.Core.Components.Transform3DComponent
            {
                Translation = new Vector3(1, 2, 3),
                Rotation    = new Vector3(4, 5, 6),
                Scale       = new Vector3(7, 8, 9)
            };

            _transformComponentModel = new Transform3DComponentModel(transformComponent);
            _transformComponentPropertiesEditorViewModel = new Transform3DComponentPropertiesEditorViewModel(_transformComponentModel);
        }