示例#1
0
        /// <summary>
        /// Handle <see cref="ExtrudedStructureEvents.WillCreate"/> event by specifying the extruded structure styles.
        /// </summary>
        public void HandleWillCreateExtrudedStructure(WillCreateExtrudedStructureArgs arguments)
        {
            var isGutBuilding = GutBuildingData.CheckIsGutBuilding(arguments.MapFeature.Metadata.PlaceId);

            if (isGutBuilding)
            {
                var mapGutStyle = MapStyleProvider.Instance.GetMapStyle(MapStyleData.Type.Gut);
                arguments.Style = mapGutStyle.ExtrudedStructureStyle;
            }
            else
            {
                arguments.Style = _mapDefaultStyle.ExtrudedStructureStyle;
            }
        }
    public void OnWillCreateExtrudedStructure(WillCreateExtrudedStructureArgs args)
    {
        if (!enabled)
        {
            return;
        }


        ExtrudedStructureStyle.Builder builder = args.Style.AsBuilder();
        builder.ApplyFixedHeight = false;
        //builder.FixedHeight = 0;


        args.Style = builder.Build();
    }
        public void WillCreateExtruded(WillCreateExtrudedStructureArgs args)
        {
            Google.Maps.Feature.Style.ExtrudedStructureStyle.Builder newStyle = new Google.Maps.Feature.Style.ExtrudedStructureStyle.Builder();
            newStyle.RoofMaterial = extrudedMaterial;
            newStyle.WallMaterial = extrudedMaterial;

            //Debug.Log(args.MapFeature.GameObjectName());
            if (args.MapFeature.MapFeatureMetadata.Name == "")
            {
                args.Cancel = true;
            }
            else
            {
                Debug.Log(args.MapFeature.MapFeatureMetadata.Name);
                args.Style = newStyle.Build();
            }
        }
示例#4
0
        /// <summary>
        /// Randomize building heights deterministically based on a random seed plus the structure's
        /// place id.
        /// </summary>
        public void OnWillCreateExtrudedStructure(WillCreateExtrudedStructureArgs args)
        {
            if (!enabled)
            {
                return;
            }

            string placeId = args.MapFeature.MapFeatureMetadata.PlaceId;
            PRNG   prng    = new PRNG(RandomSeed);

            for (int i = 0; i < placeId.Length; i++)
            {
                prng.Mix(placeId[i]);
            }

            ExtrudedStructureStyle.Builder builder = args.Style.AsBuilder();
            builder.ApplyFixedHeight = true;
            int minHeight = MinExtrudedStructureHeight;
            int maxHeight = MaxExtrudedStructureHeight;

            builder.FixedHeight = minHeight + prng.NextRandomFloat() * (maxHeight - minHeight);

            args.Style = builder.Build();
        }
 /// <summary>
 /// Handle <see cref="ExtrudedStructureEvents.WillCreate"/> event by specifying the extruded
 /// structure styles.
 /// </summary>
 /// <param name="args">Event arguments.</param>
 public void HandleWillCreateExtrudedStructure(WillCreateExtrudedStructureArgs args)
 {
     args.Style = GameObjectOptions.ExtrudedStructureStyle;
 }
示例#6
0
 /// <summary>
 /// Triggered by the Maps SDK during the loading process.
 /// Notifies the SDK if the GameObject for extruded structures needs to be created (or not)
 /// based on the value of the UI flag.
 /// </summary>
 void OnWillCreateExtrudedStructure(WillCreateExtrudedStructureArgs args)
 {
     args.Cancel = !ShowExtrudedStructures;
 }