@@ -11,12 +11,6 @@ namespace Mapbox.Unity.MeshGeneration.Modifiers
11
11
[ CreateAssetMenu ( menuName = "Mapbox/Modifiers/Prefab Modifier" ) ]
12
12
public class PrefabModifier : GameObjectModifier
13
13
{
14
- //[SerializeField]
15
- //private GameObject _prefab;
16
-
17
- //[SerializeField]
18
- //private bool _scaleDownWithWorld = false;
19
-
20
14
private Dictionary < GameObject , GameObject > _objects ;
21
15
[ SerializeField ]
22
16
private SpawnPrefabOptions _options ;
@@ -63,11 +57,11 @@ public override void Run(VectorEntity ve, UnityTile tile)
63
57
{
64
58
goRectTransform . anchoredPosition3D = met ;
65
59
}
60
+ //go.transform.localScale = Constants.Math.Vector3One;
66
61
67
-
68
- if ( ! _options . scaleDownWithWorld )
62
+ if ( _options . scaleDownWithWorld )
69
63
{
70
- go . transform . localScale = ( go . transform . localScale * ( 1.0f / tile . TileScale ) ) ;
64
+ go . transform . localScale = ( go . transform . localScale * ( tile . TileScale ) ) ;
71
65
}
72
66
return ;
73
67
}
@@ -89,19 +83,18 @@ public override void Run(VectorEntity ve, UnityTile tile)
89
83
{
90
84
goRectTransform . anchoredPosition3D = met ;
91
85
}
92
-
93
86
go . transform . SetParent ( ve . GameObject . transform , false ) ;
94
- go . transform . localScale = Constants . Math . Vector3One ;
87
+ // go.transform.localScale = Constants.Math.Vector3One;
95
88
96
89
settable = go . GetComponent < IFeaturePropertySettable > ( ) ;
97
90
if ( settable != null )
98
91
{
99
92
settable . Set ( ve . Feature . Properties ) ;
100
93
}
101
94
102
- if ( ! _options . scaleDownWithWorld )
95
+ if ( _options . scaleDownWithWorld )
103
96
{
104
- go . transform . localScale = ( go . transform . localScale * ( 1.0f / tile . TileScale ) ) ;
97
+ go . transform . localScale = ( go . transform . localScale * ( tile . TileScale ) ) ;
105
98
}
106
99
107
100
if ( _options . AllPrefabsInstatiated != null )
0 commit comments