コード例 #1
0
 public void Destroy()
 {
     MainThreadContext.RunOnUiThread(() =>
     {
         anchorNode.Renderable = null;
         anchorNode.SetParent(null);
     });
 }
コード例 #2
0
        public void SetColor(Material material)
        {
            color = material;

            MainThreadContext.RunOnUiThread(() =>
            {
                anchorNode.Renderable = null;
                //TODO: See https://github.com/xamarin/XamarinComponents/issues/584
                // nodeRenderable = ShapeFactory.MakeSphere(0.1f, new Vector3(0.0f, 0.15f, 0.0f), color);
                anchorNode.Renderable = nodeRenderable;
            });
        }
コード例 #3
0
        public void Render(ArFragment arFragment)
        {
            MainThreadContext.RunOnUiThread(() =>
            {
                //TODO: See https://github.com/xamarin/XamarinComponents/issues/584
                //nodeRenderable = ShapeFactory.MakeSphere(0.1f, new Vector3(0.0f, 0.15f, 0.0f), color);
                anchorNode.Renderable = nodeRenderable;
                anchorNode.SetParent(arFragment.ArSceneView.Scene);

                TransformableNode sphere = new TransformableNode(arFragment.TransformationSystem);
                sphere.SetParent(anchorNode);
                sphere.Renderable = nodeRenderable;
                sphere.Select();
            });
        }