Skip to content

Commit

Permalink
Fixes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
MosGeo committed Nov 2, 2021
1 parent 5b2b516 commit 695071a
Show file tree
Hide file tree
Showing 17 changed files with 84 additions and 32 deletions.
7 changes: 7 additions & 0 deletions Source/Assets/Parameters_06_Complex.txt.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Source/Assets/Resources/BillingMode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"androidStore":"GooglePlay"}
7 changes: 7 additions & 0 deletions Source/Assets/Resources/BillingMode.json.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Source/Assets/Resources/Grains/Realistic.prefab
Binary file not shown.
Binary file modified Source/Assets/Resources/Grains/Sphere.prefab
Binary file not shown.
Binary file modified Source/Assets/Scenes/Main3D.unity
Binary file not shown.
2 changes: 2 additions & 0 deletions Source/Assets/Scripts/DataSaver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public static void saveLocationData(Rock rock, string saveFolder)

var csv = new System.Text.StringBuilder();
csv.AppendLine("Name PositionX PositionY PositionZ RotationEu1 RotationEu2 RotationEu3 ScaleX ScaleY ScaleZ Mass Density Volume SurfaceArea");
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;


for (int bedNumber = 0; bedNumber < nBeds; bedNumber++)
{
Expand Down
5 changes: 3 additions & 2 deletions Source/Assets/Scripts/Distribution.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections;
using UnityEngine;
using System.Globalization;

public class Distribution{

Expand Down Expand Up @@ -86,8 +87,8 @@ public Distribution(float[,] pdfData)
if (textData[i][0] != '-')
{
string[] splitText = textData[i].Split(',');
readData[i, 0] = float.Parse(splitText[0].Trim());
readData[i, 1] = float.Parse(splitText[1].Trim());
readData[i, 0] = float.Parse(splitText[0].Trim(), CultureInfo.InvariantCulture);
readData[i, 1] = float.Parse(splitText[1].Trim(), CultureInfo.InvariantCulture);
}
}
}
Expand Down
19 changes: 10 additions & 9 deletions Source/Assets/Scripts/ParameterGroup.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using UnityEngine;
using System.Collections;
using System.Globalization;

public class ParameterGroup
{
Expand Down Expand Up @@ -81,14 +82,14 @@ private void AnalyzeParameters(string[] textData)
//===================================================================
public float getFloat(string parameterNameString) {
int results = System.Array.FindIndex(parameterName, s => s.Equals(parameterNameString));
return (float.Parse(parameterValue[results]));
return (float.Parse(parameterValue[results], CultureInfo.InvariantCulture));
}
//===================================================================

//===================================================================
public int getInteger(string parameterNameString) {
int results = System.Array.FindIndex(parameterName, s => s.Equals(parameterNameString));
return (int.Parse(parameterValue[results]));
return (int.Parse(parameterValue[results], CultureInfo.InvariantCulture));
}
//===================================================================

Expand Down Expand Up @@ -121,7 +122,7 @@ public Vector2 getVector2(string parameterNameString)
string[] resultsString = parameterValue[results].Split(' ');
resultsString[0] = resultsString[0].Remove(0, 1);
resultsString[1] = resultsString[1].Remove(resultsString[1].Length - 1);
Vector2 resultValue = new Vector2(float.Parse(resultsString[0]), float.Parse(resultsString[1]));
Vector2 resultValue = new Vector2(float.Parse(resultsString[0], CultureInfo.InvariantCulture), float.Parse(resultsString[1], CultureInfo.InvariantCulture));
return resultValue;
}

Expand All @@ -140,13 +141,13 @@ public Color getColor(string parameterNameString)
resultsString[0] = resultsString[0].Remove(0, 1);
resultsString[3] = resultsString[3].Remove(resultsString[3].Length - 1);

float r = float.Parse(resultsString[0])/ 255f;
float r = float.Parse(resultsString[0], CultureInfo.InvariantCulture) / 255f;

float g = float.Parse(resultsString[1])/ 255f;
float g = float.Parse(resultsString[1], CultureInfo.InvariantCulture) / 255f;

float b = float.Parse(resultsString[2])/ 255f;
float b = float.Parse(resultsString[2], CultureInfo.InvariantCulture) / 255f;

float a = float.Parse(resultsString[3])/ 255f;
float a = float.Parse(resultsString[3], CultureInfo.InvariantCulture) / 255f;

Color color = new Color(r,g,b,a);
return color;
Expand All @@ -165,11 +166,11 @@ public Vector2 GetRange(string parameterNameString)
{
resultsString[0] = resultsString[0].Remove(0, 1);
resultsString[1] = resultsString[1].Remove(resultsString[1].Length - 1);
resultValue = new Vector3(float.Parse(resultsString[0]), float.Parse(resultsString[1]));
resultValue = new Vector3(float.Parse(resultsString[0], CultureInfo.InvariantCulture), float.Parse(resultsString[1], CultureInfo.InvariantCulture));
}
else
{
resultValue = new Vector3(float.Parse(resultsString[0]), float.Parse(resultsString[0]));
resultValue = new Vector3(float.Parse(resultsString[0], CultureInfo.InvariantCulture), float.Parse(resultsString[0], CultureInfo.InvariantCulture));
}

return resultValue;
Expand Down
3 changes: 3 additions & 0 deletions Source/Assets/Scripts/StlExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ public static string MeshToString(GameObject[] gameObjectsToSave, Vector3 refere

StringBuilder sb = new StringBuilder();
sb.Append("solid Grains" + "\n");
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;



for (int objectNumber = 0; objectNumber < gameObjectsToSave.Length; objectNumber++)
{
Expand Down
16 changes: 8 additions & 8 deletions Source/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
"dependencies": {
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.ads": "3.6.1",
"com.unity.ads": "3.7.5",
"com.unity.analytics": "3.5.3",
"com.unity.collab-proxy": "1.3.9",
"com.unity.collab-proxy": "1.7.1",
"com.unity.ide.rider": "2.0.7",
"com.unity.ide.visualstudio": "2.0.5",
"com.unity.ide.visualstudio": "2.0.11",
"com.unity.ide.vscode": "1.2.3",
"com.unity.purchasing": "2.2.2",
"com.unity.test-framework": "1.1.22",
"com.unity.textmeshpro": "3.0.1",
"com.unity.timeline": "1.4.6",
"com.unity.purchasing": "3.2.2",
"com.unity.test-framework": "1.1.27",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.4.8",
"com.unity.ugui": "1.0.0",
"com.unity.xr.legacyinputhelpers": "2.1.7",
"com.unity.xr.legacyinputhelpers": "2.1.8",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
Expand Down
37 changes: 26 additions & 11 deletions Source/Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {}
},
"com.unity.ads": {
"version": "3.6.1",
"version": "3.7.5",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -31,10 +31,12 @@
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "1.3.9",
"version": "1.7.1",
"depth": 0,
"source": "registry",
"dependencies": {},
"dependencies": {
"com.unity.nuget.newtonsoft-json": "2.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
Expand All @@ -54,10 +56,12 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.5",
"version": "2.0.11",
"depth": 0,
"source": "registry",
"dependencies": {},
"dependencies": {
"com.unity.test-framework": "1.1.9"
},
"url": "https://packages.unity.com"
},
"com.unity.ide.vscode": {
Expand All @@ -67,17 +71,28 @@
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.nuget.newtonsoft-json": {
"version": "2.0.0",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.purchasing": {
"version": "2.2.2",
"version": "3.2.2",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0"
"com.unity.ugui": "1.0.0",
"com.unity.modules.unityanalytics": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.androidjni": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.22",
"version": "1.1.27",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -88,7 +103,7 @@
"url": "https://packages.unity.com"
},
"com.unity.textmeshpro": {
"version": "3.0.1",
"version": "3.0.6",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -97,7 +112,7 @@
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.4.6",
"version": "1.4.8",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -118,7 +133,7 @@
}
},
"com.unity.xr.legacyinputhelpers": {
"version": "2.1.7",
"version": "2.1.8",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down
Binary file modified Source/ProjectSettings/ProjectSettings.asset
Binary file not shown.
4 changes: 2 additions & 2 deletions Source/ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2020.2.6f1
m_EditorVersionWithRevision: 2020.2.6f1 (8a2143876886)
m_EditorVersion: 2020.3.17f1
m_EditorVersionWithRevision: 2020.3.17f1 (a4537701e4ab)
Binary file modified Source/ProjectSettings/TimeManager.asset
Binary file not shown.
15 changes: 15 additions & 0 deletions Source/ProjectSettings/TimelineSettings.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 61
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a287be6c49135cd4f9b2b8666c39d999, type: 3}
m_Name:
m_EditorClassIdentifier:
assetDefaultFramerate: 60
Binary file modified Source/ProjectSettings/UnityConnectSettings.asset
Binary file not shown.

0 comments on commit 695071a

Please sign in to comment.