void OnPointCloudUpdated(PointCloudUpdatedEventArgs eventArgs)
        {
            if (pointCloud == null)
            {
                GameObject newGameObject;
                if (pointCloudPrefab != null)
                {
                    newGameObject = Instantiate(pointCloudPrefab, m_SessionOrigin.trackablesParent);
                    newGameObject.transform.localPosition = Vector3.zero;
                    newGameObject.transform.localRotation = Quaternion.identity;
                    newGameObject.transform.localScale    = Vector3.one;
                }
                else
                {
                    newGameObject = new GameObject();
                    newGameObject.transform.SetParent(m_SessionOrigin.trackablesParent, false);
                }

                newGameObject.layer = gameObject.layer;

                pointCloud = newGameObject.GetComponent <ARPointCloud>();
                if (pointCloud == null)
                {
                    pointCloud = newGameObject.AddComponent <ARPointCloud>();
                }
            }

            pointCloud.OnUpdated();

            if (pointCloudUpdated != null)
            {
                pointCloudUpdated(new ARPointCloudUpdatedEventArgs(pointCloud));
            }
        }
예제 #2
0
 static void OnPointCloudUpdated(PointCloudUpdatedEventArgs eventArgs)
 {
     if (s_PointCloudUpdated != null)
     {
         s_PointCloudUpdated(eventArgs);
     }
 }
예제 #3
0
        private void ARSubsystemManager_PointCloudUpdated(PointCloudUpdatedEventArgs obj)
        {
            obj.DepthSubsystem.GetPoints(depthPoints);

            if (pointsDataSender != null)
            {
                pointsDataSender.SendPointCloudUpdated(connectionProvider, depthPoints);
            }
        }