コード例 #1
0
        /// <summary>
        /// Read map file and create keyframe and mappoint as Unity3d object.
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns>MapViewer gameobject</returns>
        public bool Load(string fileName)
        {
            if (!ReadMap(fileName))
            {
                return(false);
            }

            Debug.Log("Read Json Success");

            mapRendererBehaviour = gameObject.GetComponent <MapRendererBehaviour>();
            if (mapRendererBehaviour == null)
            {
                mapRendererBehaviour = gameObject.AddComponent <MapRendererBehaviour>();
            }

            mapRendererBehaviour.Clear();
            mapRendererBehaviour.Create(vertices, cameraMatrices, materials);

            if (tagAnchors != null)
            {
                mapRendererBehaviour.CreateAnchors(tagAnchors);
            }

            SetTransparent(transparent);
            UpdateMapViewer();

            return(true);
        }
コード例 #2
0
        public override void OnInspectorGUI()
        {
            if (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab)
            {
                return;
            }

            // Please don't remove below code
            mapRendererBehaviour = (MapRendererBehaviour)target;
        }