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); }
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; }
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; }