Exemplo n.º 1
0
 private void this_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
 {
     VisualTreeHelper.HitTest(this,
         //null
         (hittestDepObj) =>
         {
             _currentRotateableVisual = hittestDepObj as IRotateable;
             return _currentRotateableVisual != null ? HitTestFilterBehavior.Stop : HitTestFilterBehavior.ContinueSkipSelf;
         }
         ,
         (r) => { return HitTestResultBehavior.Continue; }
         //(result) =>
         //{ _currentRotateableVisual = result.VisualHit as IRotateable;
         //    return _currentRotateableVisual!= null? HitTestResultBehavior.Stop: HitTestResultBehavior.Continue;}
         ,
         new PointHitTestParameters(e.ManipulationOrigin));
 }
Exemplo n.º 2
0
 private void this_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
 {
     VisualTreeHelper.HitTest(this,
                              //null
                              (hittestDepObj) =>
     {
         _currentRotateableVisual = hittestDepObj as IRotateable;
         return(_currentRotateableVisual != null ? HitTestFilterBehavior.Stop : HitTestFilterBehavior.ContinueSkipSelf);
     }
                              ,
                              (r) => { return(HitTestResultBehavior.Continue); }
                              //(result) =>
                              //{ _currentRotateableVisual = result.VisualHit as IRotateable;
                              //    return _currentRotateableVisual!= null? HitTestResultBehavior.Stop: HitTestResultBehavior.Continue;}
                              ,
                              new PointHitTestParameters(e.ManipulationOrigin));
 }
Exemplo n.º 3
0
 private void CacheRotateComponent() =>
 Rotate = (rotateTarget != null ? rotateTarget : gameObject).GetComponent <IRotateable>();
Exemplo n.º 4
0
    private void Rotate(IRotateable entity)
    {
        var currentCardinalPoint = this.Compass.GetNextCardinalPoint(entity.Orientation);

        entity.Rotate(currentCardinalPoint);
    }
 private void Start()
 {
     _moveController   = (moveTarget != null ? moveTarget : gameObject).GetComponent <IMoveable>();
     _rotateController = (rotateTarget != null ? rotateTarget : gameObject).GetComponent <IRotateable>();
 }