Ejemplo n.º 1
0
        void HandleTapGesture(UITapGestureRecognizer sender)
        {
            SCNView areaPanned = sender.View as SCNView;
            CGPoint point      = sender.LocationInView(areaPanned);

            SCNHitTestResult[] hitResults = areaPanned.HitTest(point, new SCNHitTestOptions());
            SCNHitTestResult   hit        = hitResults.FirstOrDefault();

            if (hit != null)
            {
                SCNNode node = hit.Node;
                if (node != null)
                {
                    if (!isAnimating)
                    {
                        node.AddRotationAction(SCNActionTimingMode.Linear, 3, true);
                        isAnimating = true;
                    }
                    else
                    {
                        node.RemoveAction("rotation");
                        isAnimating = false;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void StopPulsing(SCNNode node)
        {
            if (node == null)
            {
                return;
            }

            node.RemoveAction("pulse");
            node.Opacity = 1.0f;
        }