Skip to content

Commit 5893fb9

Browse files
Fixed private field naming to meet code style requirements.
1 parent 5f04419 commit 5893fb9

File tree

3 files changed

+39
-39
lines changed

3 files changed

+39
-39
lines changed

sdkproject/Assets/Mapbox/Unity/MeshGeneration/Modifiers/GameObjectModifiers/MapboxStylesColorModifier.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ public class MapboxStylesColorModifier : GameObjectModifier
99

1010
public ScriptablePalette m_scriptablePalette;
1111

12-
private const string BASE_COLOR_NAME = "_BaseColor";
13-
private const string DETAIL_ONE_COLOR_NAME = "_DetailColor1";
14-
private const string DETAIL_TWO_COLOR_NAME = "_DetailColor2";
12+
private const string _BASE_COLOR_NAME = "_BaseColor";
13+
private const string _DETAIL_ONE_COLOR_NAME = "_DetailColor1";
14+
private const string _DETAIL_TWO_COLOR_NAME = "_DetailColor2";
1515

16-
private int m_baseColorId;
17-
private int m_detailOneColorId;
18-
private int m_detailTWoColorId;
16+
private int _baseColorId;
17+
private int _detailOneColorId;
18+
private int _detailTWoColorId;
1919

2020
public override void Initialize()
2121
{
2222
Assert.IsNotNull(m_scriptablePalette, "No scriptable palette assigned.");
2323
Assert.IsTrue(m_scriptablePalette.m_colors.Length > 0, "No color palette defined in scriptable palette.");
2424

25-
m_baseColorId = Shader.PropertyToID(BASE_COLOR_NAME);
26-
m_detailOneColorId = Shader.PropertyToID(DETAIL_ONE_COLOR_NAME);
27-
m_detailTWoColorId = Shader.PropertyToID(DETAIL_TWO_COLOR_NAME);
25+
_baseColorId = Shader.PropertyToID(_BASE_COLOR_NAME);
26+
_detailOneColorId = Shader.PropertyToID(_DETAIL_ONE_COLOR_NAME);
27+
_detailTWoColorId = Shader.PropertyToID(_DETAIL_TWO_COLOR_NAME);
2828
}
2929

3030
private Color GetRandomColorFromPalette()
@@ -49,9 +49,9 @@ public override void Run(VectorEntity ve, UnityTile tile)
4949
Color detailColor1 = (m_scriptablePalette.m_setDetailColor1_Override) ? m_scriptablePalette.m_detailColor1_Override : GetRandomColorFromPalette();
5050
Color detailColor2 = (m_scriptablePalette.m_setDetailColor2_Override) ? m_scriptablePalette.m_detailColor2_Override : GetRandomColorFromPalette();
5151

52-
propBlock.SetColor(m_baseColorId, baseColor);
53-
propBlock.SetColor(m_detailOneColorId, detailColor1);
54-
propBlock.SetColor(m_detailTWoColorId, detailColor2);
52+
propBlock.SetColor(_baseColorId, baseColor);
53+
propBlock.SetColor(_detailOneColorId, detailColor1);
54+
propBlock.SetColor(_detailTWoColorId, detailColor2);
5555

5656
ve.MeshRenderer.SetPropertyBlock(propBlock);
5757
}

sdkproject/Assets/MapboxDevTools/Editor/AtlasTemplateGenerator.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ public class PixelRect
3434
public bool m_generateFacadesTemplate = true;
3535
public bool m_generateRoofsTemplate = false;
3636

37-
private int m_drawCount;
37+
private int _drawCount;
3838

39-
private const int DEFAULT_TEX_SIZE = 2048;
40-
private const int MIN_TEX_SIZE = 512;
41-
private const int MAX_TEX_SIZE = 2048;
39+
private const int _DEFAULT_TEX_SIZE = 2048;
40+
private const int _MIN_TEX_SIZE = 512;
41+
private const int _MAX_TEX_SIZE = 2048;
4242

43-
private const float m_cellRatioMargin = 0.01f;
43+
private const float _cellRatioMargin = 0.01f;
4444

4545
private void Awake()
4646
{
@@ -115,7 +115,7 @@ void OnGUI()
115115

116116
EditorGUI.BeginChangeCheck();
117117

118-
m_textureResolution = Mathf.Clamp(EditorGUILayout.IntField("Texture resolution:", m_textureResolution), MIN_TEX_SIZE, MAX_TEX_SIZE);
118+
m_textureResolution = Mathf.Clamp(EditorGUILayout.IntField("Texture resolution:", m_textureResolution), _MIN_TEX_SIZE, _MAX_TEX_SIZE);
119119

120120
if (EditorGUI.EndChangeCheck())
121121
{
@@ -259,7 +259,7 @@ private void DrawAtlasEntityData(List<AtlasEntity> aeList)
259259
PixelRect groundFloorPixelRect = ConvertUVRectToPixelRect(groundFloorRect);
260260
PixelRect topFloorPixelRect = ConvertUVRectToPixelRect(topFloorRect);
261261

262-
Color color = m_colors[m_drawCount];
262+
Color color = m_colors[_drawCount];
263263
Color colorLight = (color + Color.white) / 2;
264264
Color colorDark = (color + Color.black) / 2;
265265

@@ -278,7 +278,7 @@ private void DrawAtlasEntityData(List<AtlasEntity> aeList)
278278

279279
float midFloorBase = baseRect.y + bottomRatio;
280280

281-
float mrgn = m_cellRatioMargin;
281+
float mrgn = _cellRatioMargin;
282282
float halfMrgn = mrgn / 2;
283283

284284
for (int j = 0; j < numMidFloors; j++)
@@ -298,13 +298,13 @@ private void DrawAtlasEntityData(List<AtlasEntity> aeList)
298298
}
299299
DrawCornerWatermarks(groundFloorPixelRect);
300300
DrawCornerWatermarks(topFloorPixelRect);
301-
m_drawCount++;
301+
_drawCount++;
302302
}
303303
}
304304

305305
public void GenerateTemplate()
306306
{
307-
m_drawCount = 0;
307+
_drawCount = 0;
308308
if(m_generateFacadesTemplate)
309309
{
310310
DrawAtlasEntityData(m_atlasInfo.Textures);

sdkproject/Assets/MapboxDevTools/Editor/ScriptablePaletteEditor.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
[CustomEditor(typeof(ScriptablePalette))]
88
public class ScriptablePaletteEditor : Editor
99
{
10-
private const int NUM_COLORS_MIN = 3;
11-
private const int NUM_COLORS_MAX = 10;
10+
private const int _NUM_COLORS_MIN = 3;
11+
private const int _NUM_COLORS_MAX = 10;
1212

13-
private const float HELPER_TEXT_COLOR_VAL = 0.7f;
13+
private const float _HELPER_TEXT_COLOR_VAL = 0.7f;
1414

15-
private const string COLOR_FIELD_PREFIX = "Color {0}";
15+
private const string _COLOR_FIELD_PREFIX = "Color {0}";
1616

17-
private const string KEY_COLOR_INFO = "Color used as a seed for generating the color palette";
18-
private const string NUM_COLOR_INFO = "Number of colors to generate in the palette";
17+
private const string _KEY_COLOR_INFO = "Color used as a seed for generating the color palette";
18+
private const string _NUM_COLOR_INFO = "Number of colors to generate in the palette";
1919

20-
private const string HUE_RANGE_INFO = "Maximum range that randomly generated colors will deviate from the key color hue";
21-
private const string SAT_RANGE_INFO = "Maximum range that randomly generated colors will deviate from the key color saturation";
22-
private const string VAL_RANGE_INFO = "Maximum range that randomly generated colors will deviate from the key color value";
20+
private const string _HUE_RANGE_INFO = "Maximum range that randomly generated colors will deviate from the key color hue";
21+
private const string _SAT_RANGE_INFO = "Maximum range that randomly generated colors will deviate from the key color saturation";
22+
private const string _VAL_RANGE_INFO = "Maximum range that randomly generated colors will deviate from the key color value";
2323

2424
override public void OnInspectorGUI()
2525
{
@@ -29,7 +29,7 @@ override public void OnInspectorGUI()
2929

3030
GUIStyle wrapTextStyle = new GUIStyle();
3131
wrapTextStyle.wordWrap = true;
32-
wrapTextStyle.normal.textColor = new Color(HELPER_TEXT_COLOR_VAL, HELPER_TEXT_COLOR_VAL, HELPER_TEXT_COLOR_VAL, 1.0f);
32+
wrapTextStyle.normal.textColor = new Color(_HELPER_TEXT_COLOR_VAL, _HELPER_TEXT_COLOR_VAL, _HELPER_TEXT_COLOR_VAL, 1.0f);
3333

3434
EditorGUILayout.LabelField("Generate a palette for building colorization by defining a key color, palette size and hue/saturation/value range parameters.", wrapTextStyle);
3535

@@ -39,17 +39,17 @@ override public void OnInspectorGUI()
3939

4040
EditorGUILayout.Space();
4141

42-
GUIContent keyColorContent = new GUIContent("Key color", KEY_COLOR_INFO);
42+
GUIContent keyColorContent = new GUIContent("Key color", _KEY_COLOR_INFO);
4343
sp.m_keyColor = EditorGUILayout.ColorField(keyColorContent, sp.m_keyColor);
4444

4545
EditorGUILayout.Space();
4646

47-
GUIContent numColorContent = new GUIContent("Palette Size", NUM_COLOR_INFO);
48-
sp.m_numColors = EditorGUILayout.IntSlider(numColorContent, sp.m_numColors, NUM_COLORS_MIN, NUM_COLORS_MAX);
47+
GUIContent numColorContent = new GUIContent("Palette Size", _NUM_COLOR_INFO);
48+
sp.m_numColors = EditorGUILayout.IntSlider(numColorContent, sp.m_numColors, _NUM_COLORS_MIN, _NUM_COLORS_MAX);
4949

50-
GUIContent hueRangeContent = new GUIContent("Hue Range", HUE_RANGE_INFO);
51-
GUIContent satRangeContent = new GUIContent("Saturation Range", SAT_RANGE_INFO);
52-
GUIContent valRangeContent = new GUIContent("Value Range", VAL_RANGE_INFO);
50+
GUIContent hueRangeContent = new GUIContent("Hue Range", _HUE_RANGE_INFO);
51+
GUIContent satRangeContent = new GUIContent("Saturation Range", _SAT_RANGE_INFO);
52+
GUIContent valRangeContent = new GUIContent("Value Range", _VAL_RANGE_INFO);
5353

5454
sp.m_hueRange = EditorGUILayout.Slider(hueRangeContent, sp.m_hueRange, 0, 1);
5555
sp.m_saturationRange = EditorGUILayout.Slider(satRangeContent, sp.m_saturationRange, 0, 1);
@@ -72,7 +72,7 @@ override public void OnInspectorGUI()
7272
{
7373
for (int i = 0; i < sp.m_colors.Length; i++)
7474
{
75-
string fieldName = string.Format(COLOR_FIELD_PREFIX, i);
75+
string fieldName = string.Format(_COLOR_FIELD_PREFIX, i);
7676
sp.m_colors[i] = EditorGUILayout.ColorField(fieldName, sp.m_colors[i]);
7777
}
7878
}

0 commit comments

Comments
 (0)