public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            ARMap targ = target as ARMap;

            TextAsset map = (TextAsset)EditorGUILayout.ObjectField(new GUIContent("Map File", ".bytes file from the Developer Portal"), targ.m_MapFile, typeof(TextAsset), false);

            if (map != targ.m_MapFile)
            {
                targ.m_MapFile = map;
                targ.InitMesh();
                EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
            }

            Color color = (Color)EditorGUILayout.ColorField(new GUIContent("Color", "point cloud color"), targ.m_Color);

            if (color != targ.m_Color)
            {
                targ.m_Color = color;
                targ.InitMesh();
                EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
            }

            ARMap.RenderMode renderMode = (ARMap.RenderMode)EditorGUILayout.EnumPopup(new GUIContent("Render Mode", "when to render the point cloud"), targ.m_RenderMode);
            if (renderMode != targ.m_RenderMode)
            {
                targ.m_RenderMode = renderMode;
                targ.InitMesh();
                EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
            }
        }
Beispiel #2
0
        public void LoadMap(SDKJob job)
        {
            JobLoadMapBinaryAsync j = new JobLoadMapBinaryAsync();

            j.id        = job.id;
            j.OnResult += (SDKMapResult result) =>
            {
                Debug.Log(string.Format("Load map {0} ({1} bytes)", job.id, result.mapData.Length));

                Color            pointCloudColor = ARMap.pointCloudColors[UnityEngine.Random.Range(0, ARMap.pointCloudColors.Length)];
                ARMap.RenderMode renderMode      = m_ARMap?.renderMode ?? ARMap.RenderMode.EditorAndRuntime;

                ARSpace.LoadAndInstantiateARMap(null, result, renderMode, pointCloudColor);
            };

            m_Jobs.Add(j);
        }