Skip to content

Commit

Permalink
Merge from 'develop' into 'main' for CLOiSim-4.3.0 (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunseok-yang authored Feb 1, 2024
2 parents 1ea795c + 38b6429 commit 80989e0
Show file tree
Hide file tree
Showing 36 changed files with 1,280 additions and 130 deletions.
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"files.exclude": {
".vscode": true,
"**/*.meta": true,
"Library": true,
"Temp": true,
"UserSettings": true
},
"editor.detectIndentation": false,
"editor.indentSize": "tabSize",
"editor.insertSpaces": false,
"editor.tabSize": 4,
}
37 changes: 36 additions & 1 deletion Assets/Scenes/MainScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1843,13 +1843,16 @@ MonoBehaviour:
- ../sample_resources/models/
- ../world_resources/yangjae_city
- ../world_resources/bluepearl/models
- ../../props_resources
- ../props_resources
- ../world_resources/lawn_ground/models
worldRootDirectories:
- ../sample_resources/worlds/
- ../world_resources/bluepearl/worlds
- ../world_resources/lawn_ground/worlds
fileRootDirectories:
- ../sample_resources/media/
- ../world_resources/bluepearl/media
- ../world_resources/lawn_ground
--- !u!1 &314493398
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -3896,6 +3899,37 @@ ArticulationBody:
m_Immovable: 0
m_UseGravity: 1
m_CollisionDetectionMode: 0
--- !u!1 &648266123
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 648266124}
m_Layer: 0
m_Name: Roads
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &648266124
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 648266123}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &683297084
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -9158,4 +9192,5 @@ SceneRoots:
- {fileID: 333360876}
- {fileID: 622325895}
- {fileID: 167231047}
- {fileID: 648266124}
- {fileID: 126105769}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected void OnDestroy()

thread.Dispose();
transport.Dispose();
Debug.LogFormat("({0}){0}, CLOiSimPlugin destroyed.", type.ToString(), name);
Debug.Log($"({type.ToString()}){name}, CLOiSimPlugin destroyed.");
}

public void ChangePluginType(in ICLOiSimPlugin.Type targetType)
Expand Down
12 changes: 8 additions & 4 deletions Assets/Scripts/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ public class Main : MonoBehaviour

private FollowingTargetList followingList = null;

private static GameObject coreObject = null;
private static GameObject _core = null;
private static GameObject propsRoot = null;
private static GameObject worldRoot = null;
private static GameObject lightsRoot = null;
private static GameObject _roadsRoot = null;
private static GameObject uiRoot = null;
private static GameObject uiMainCanvasRoot = null;

Expand All @@ -53,7 +54,8 @@ public class Main : MonoBehaviour

public static GameObject PropsRoot => propsRoot;
public static GameObject WorldRoot => worldRoot;
public static GameObject CoreObject => coreObject;
public static GameObject RoadsRoot => _roadsRoot;
public static GameObject CoreObject => _core;
public static GameObject UIObject => uiRoot;
public static GameObject UIMainCanvas => uiMainCanvasRoot;
public static RuntimeGizmos.TransformGizmo Gizmos => transformGizmo;
Expand Down Expand Up @@ -205,15 +207,16 @@ void Awake()
mainCamera.allowHDR = true;
mainCamera.allowMSAA = true;

coreObject = GameObject.Find("Core");
if (coreObject == null)
_core = GameObject.Find("Core");
if (_core == null)
{
Debug.LogError("Failed to Find 'Core'!!!!");
}

propsRoot = GameObject.Find("Props");
worldRoot = GameObject.Find("World");
lightsRoot = GameObject.Find("Lights");
_roadsRoot = GameObject.Find("Roads");
uiRoot = GameObject.Find("UI");

if (uiRoot != null)
Expand Down Expand Up @@ -379,6 +382,7 @@ private IEnumerator LoadWorld()
_sdfLoader = new SDF.Import.Loader();
_sdfLoader.SetRootModels(worldRoot);
_sdfLoader.SetRootLights(lightsRoot);
_sdfLoader.SetRootRoads(_roadsRoot);

yield return _sdfLoader.StartImport(world);

Expand Down
6 changes: 3 additions & 3 deletions Assets/Scripts/Tools/Mesh/Assimp.Mesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ public partial class MeshLoader
{
private static Dictionary<string, GameObject> GameObjectCache = new Dictionary<string, GameObject>();

private static Texture2D GetTexture(in string textureFullPath)
public static Texture2D GetTexture(in string textureFullPath)
{
if (!string.IsNullOrEmpty(textureFullPath))
if (!string.IsNullOrEmpty(textureFullPath) && File.Exists(textureFullPath))
{
var byteArray = File.ReadAllBytes(textureFullPath);
if (byteArray != null)
{
var texture = new Texture2D(2, 2);
var texture = new Texture2D(1, 1);
if (texture.LoadImage(byteArray))
{
return texture;
Expand Down
Loading

0 comments on commit 80989e0

Please sign in to comment.