Example #1
0
        public void ListenerUpdatesPositionWithTransformInitiallyTest()
        {
            var Entity = new Entity();
            var AudioListenerComponent = AudioListener.Create(Entity).SetUpdatePositionWithTransform(true);
            var TransformComponent     = Transform.Create(Entity).SetPosition(1, 2);

            Entity.Initialize(false);

            Assert.AreEqual(1 / AudioListenerComponent.Scale, AudioListenerComponent.Listener.Position.X);
            Assert.AreEqual(2 / AudioListenerComponent.Scale, AudioListenerComponent.Listener.Position.Y);
        }
Example #2
0
        public void ListenerUpdatesPositionWithTransformTest()
        {
            var Entity = new Entity();
            var AudioListenerComponent = AudioListener.Create(Entity).SetUpdatePositionWithTransform(true);
            var TransformComponent     = Transform.Create(Entity);

            Entity.Initialize(false);

            TransformComponent.Position = new Microsoft.Xna.Framework.Vector2(1, 2);

            Assert.AreEqual(1 / AudioListenerComponent.Scale, AudioListenerComponent.Listener.Position.X);
            Assert.AreEqual(2 / AudioListenerComponent.Scale, AudioListenerComponent.Listener.Position.Y);
        }