コード例 #1
0
        public void Update_OnTouchSketcherCameraEnabledAndHudDisabled()
        {
            var touch = new Touch
            {
                position = new Vector2(4, 4), deltaPosition = new Vector2(2, 2), phase = TouchPhase.Began
            };

            _graffitiWallBehaviour.inputHandler = new MockInputHandler(new List <Touch> {
                touch
            });
            _graffitiWallBehaviour.physicsHandler = MockPhysicsHandler <GraffitiWallBehaviour>
                                                    .ReturnsDetected(_graffitiWallBehaviour);

            _graffitiWallBehaviour.sketcherSurface.SetActive(false);
            _graffitiWallBehaviour.enabled = true;

            _graffitiWallBehaviour.Update();

            AssertIsInSketcherMode();
        }
コード例 #2
0
        public void Update_WhenTouchOnMarkerIsDetectedSetMarkerActive()
        {
            var touch = new Touch
            {
                position = new Vector2(4, 4), deltaPosition = new Vector2(2, 2), phase = TouchPhase.Began
            };

            _controlBehaviour.inputHandler = new MockInputHandler(new List <Touch> {
                touch
            });

            var uniqueIdentifier = "Aqua-pup Castle";

            _markerGameObject.name           = uniqueIdentifier;
            _controlBehaviour.physicsHandler = MockPhysicsHandler <MarkerControlBehaviour> .ReturnsDetected(_controlBehaviour);

            _controlBehaviour.marker = new Marker("Mr. Mime's Karaoke Fun Times", 0, 0);

            _controlBehaviour.Start();

            _controlBehaviour.Update();

            Assert.IsTrue(_controlBehaviour.marker.Active);
        }