예제 #1
0
        private SceneGroup OnSceneGroupData(SceneGroup.Type type, string name, SceneGroup parent, ref SceneGroup leaf)
        {
            SceneGroup group = null;

            if (SceneGroup.Test(type, groupOptions))
            {
                if (parent.childs.ContainsKey(name))
                {
                    group = parent.childs[name];
                }

                // No group found for this idenfier
                if (group == null)
                {
                    group = new SceneGroup(type, name);
                    parent.childs[name] = group;
                }

                // Update the leaf
                if (SceneGroup.IsLeaf(type, groupOptions))
                {
                    leaf = group;
                }
            }
            else
            {
                group = parent;
            }

            return(group);
        }
예제 #2
0
    private void SceneGroupToggle(MapzenMap mapzenMap, SceneGroup.Type type)
    {
        bool isSet = SceneGroup.Test(type, mapzenMap.GroupOptions);

        isSet = EditorGUILayout.Toggle(type.ToString(), isSet);

        mapzenMap.GroupOptions = isSet ?
                                 mapzenMap.GroupOptions | type :
                                 mapzenMap.GroupOptions & ~type;
    }
예제 #3
0
        public TileTask(TileAddress address, SceneGroup.Type groupOptions, byte[] response, float offsetX, float offsetY, float regionScaleRatio)
        {
            this.address          = address;
            this.response         = response;
            this.ready            = false;
            this.groupOptions     = groupOptions;
            this.inverseTileScale = 1.0f / (float)address.GetSizeMercatorMeters();

            float     scaleRatio = (float)address.GetSizeMercatorMeters() * regionScaleRatio;
            Matrix4x4 scale      = Matrix4x4.Scale(new Vector3(scaleRatio, scaleRatio, scaleRatio));
            Matrix4x4 translate  = Matrix4x4.Translate(new Vector3(offsetX * scaleRatio, 0.0f, offsetY * scaleRatio));

            this.transform = translate * scale;
        }