diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index dfa40a3..ce92eb6 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -331,94 +331,6 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 267250012} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &349804698 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 349804699} - - component: {fileID: 349804700} - m_Layer: 0 - m_Name: exit1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &349804699 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 349804698} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -10, y: 0, z: 2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &349804700 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 349804698} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} ---- !u!1 &496844663 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 496844664} - - component: {fileID: 496844665} - m_Layer: 0 - m_Name: exit2 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &496844664 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 496844663} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -2, y: 0, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &496844665 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 496844663} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} --- !u!1 &555903562 GameObject: m_ObjectHideFlags: 0 @@ -585,44 +497,6 @@ m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &616330206 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 616330207} - m_Layer: 0 - m_Name: Level - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &616330207 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 616330206} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.5, y: 1.5, z: 1.5} - m_Children: - - {fileID: 2127136780} - - {fileID: 1238973364} - - {fileID: 1380320608} - - {fileID: 1720606668} - - {fileID: 349804699} - - {fileID: 496844664} - - {fileID: 1551909213} - - {fileID: 861726357} - m_Father: {fileID: 0} - m_RootOrder: 8 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &705507993 GameObject: m_ObjectHideFlags: 0 @@ -716,50 +590,6 @@ m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1 &861726356 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 861726357} - - component: {fileID: 861726358} - m_Layer: 0 - m_Name: exit4 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &861726357 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 861726356} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2, y: 0, z: 10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 7 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &861726358 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 861726356} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} --- !u!1 &887232955 GameObject: m_ObjectHideFlags: 0 @@ -1268,56 +1098,6 @@ m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} ---- !u!1 &1238973363 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1238973364} - - component: {fileID: 1238973365} - m_Layer: 0 - m_Name: spawn2 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1238973364 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1238973363} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2, y: 0, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1238973365 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1238973363} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 349804700} - - {fileID: 1551909214} - - {fileID: 861726358} - timeLeft: 0 - interval: 2 --- !u!1 &1256630289 GameObject: m_ObjectHideFlags: 0 @@ -1447,100 +1227,6 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1331646751} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &1380320607 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1380320608} - - component: {fileID: 1380320609} - m_Layer: 0 - m_Name: spawn3 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1380320608 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1380320607} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 10, y: 0, z: 2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1380320609 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1380320607} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 349804700} - - {fileID: 496844665} - - {fileID: 861726358} - timeLeft: 0 - interval: 2 ---- !u!1 &1551909212 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1551909213} - - component: {fileID: 1551909214} - m_Layer: 0 - m_Name: exit3 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1551909213 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1551909212} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 10, y: 0, z: -2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1551909214 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1551909212} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} --- !u!1 &1621584771 GameObject: m_ObjectHideFlags: 0 @@ -1724,56 +1410,6 @@ material: {fileID: 2100000, guid: e2c5b6e79b6cdb545863f245ced42125, type: 2} config: {fileID: 128843415} drawMode: 0 ---- !u!1 &1720606667 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1720606668} - - component: {fileID: 1720606669} - m_Layer: 0 - m_Name: spawn4 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1720606668 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1720606667} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -2, y: 0, z: 10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1720606669 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1720606667} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 349804700} - - {fileID: 496844665} - - {fileID: 1551909214} - timeLeft: 0 - interval: 2 --- !u!1 &1812881467 GameObject: m_ObjectHideFlags: 0 @@ -1908,53 +1544,3 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1812881467} m_CullTransparentMesh: 1 ---- !u!1 &2127136779 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2127136780} - - component: {fileID: 2127136781} - m_Layer: 0 - m_Name: spawn1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2127136780 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2127136779} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -10, y: 0, z: -2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &2127136781 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2127136779} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 1551909214} - - {fileID: 496844665} - - {fileID: 861726358} - timeLeft: 0 - interval: 2 diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index dfa40a3..ce92eb6 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -331,94 +331,6 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 267250012} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &349804698 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 349804699} - - component: {fileID: 349804700} - m_Layer: 0 - m_Name: exit1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &349804699 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 349804698} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -10, y: 0, z: 2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &349804700 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 349804698} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} ---- !u!1 &496844663 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 496844664} - - component: {fileID: 496844665} - m_Layer: 0 - m_Name: exit2 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &496844664 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 496844663} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -2, y: 0, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &496844665 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 496844663} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} --- !u!1 &555903562 GameObject: m_ObjectHideFlags: 0 @@ -585,44 +497,6 @@ m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &616330206 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 616330207} - m_Layer: 0 - m_Name: Level - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &616330207 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 616330206} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.5, y: 1.5, z: 1.5} - m_Children: - - {fileID: 2127136780} - - {fileID: 1238973364} - - {fileID: 1380320608} - - {fileID: 1720606668} - - {fileID: 349804699} - - {fileID: 496844664} - - {fileID: 1551909213} - - {fileID: 861726357} - m_Father: {fileID: 0} - m_RootOrder: 8 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &705507993 GameObject: m_ObjectHideFlags: 0 @@ -716,50 +590,6 @@ m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1 &861726356 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 861726357} - - component: {fileID: 861726358} - m_Layer: 0 - m_Name: exit4 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &861726357 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 861726356} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2, y: 0, z: 10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 7 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &861726358 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 861726356} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} --- !u!1 &887232955 GameObject: m_ObjectHideFlags: 0 @@ -1268,56 +1098,6 @@ m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} ---- !u!1 &1238973363 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1238973364} - - component: {fileID: 1238973365} - m_Layer: 0 - m_Name: spawn2 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1238973364 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1238973363} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2, y: 0, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1238973365 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1238973363} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 349804700} - - {fileID: 1551909214} - - {fileID: 861726358} - timeLeft: 0 - interval: 2 --- !u!1 &1256630289 GameObject: m_ObjectHideFlags: 0 @@ -1447,100 +1227,6 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1331646751} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &1380320607 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1380320608} - - component: {fileID: 1380320609} - m_Layer: 0 - m_Name: spawn3 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1380320608 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1380320607} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 10, y: 0, z: 2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1380320609 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1380320607} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 349804700} - - {fileID: 496844665} - - {fileID: 861726358} - timeLeft: 0 - interval: 2 ---- !u!1 &1551909212 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1551909213} - - component: {fileID: 1551909214} - m_Layer: 0 - m_Name: exit3 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1551909213 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1551909212} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 10, y: 0, z: -2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1551909214 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1551909212} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} --- !u!1 &1621584771 GameObject: m_ObjectHideFlags: 0 @@ -1724,56 +1410,6 @@ material: {fileID: 2100000, guid: e2c5b6e79b6cdb545863f245ced42125, type: 2} config: {fileID: 128843415} drawMode: 0 ---- !u!1 &1720606667 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1720606668} - - component: {fileID: 1720606669} - m_Layer: 0 - m_Name: spawn4 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1720606668 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1720606667} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -2, y: 0, z: 10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1720606669 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1720606667} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 349804700} - - {fileID: 496844665} - - {fileID: 1551909214} - timeLeft: 0 - interval: 2 --- !u!1 &1812881467 GameObject: m_ObjectHideFlags: 0 @@ -1908,53 +1544,3 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1812881467} m_CullTransparentMesh: 1 ---- !u!1 &2127136779 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2127136780} - - component: {fileID: 2127136781} - m_Layer: 0 - m_Name: spawn1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2127136780 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2127136779} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -10, y: 0, z: -2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &2127136781 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2127136779} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 1551909214} - - {fileID: 496844665} - - {fileID: 861726358} - timeLeft: 0 - interval: 2 diff --git a/Assets/Scripts/Buttons/LoadButton.cs b/Assets/Scripts/Buttons/LoadButton.cs index 2724452..a9044e1 100644 --- a/Assets/Scripts/Buttons/LoadButton.cs +++ b/Assets/Scripts/Buttons/LoadButton.cs @@ -17,7 +17,7 @@ if (filePath.Length == 0) { return; } - // todo: clear scene of all currently build nodes and roads and ensure Config.roadNetwork is empty + config.roadNetwork.clear(); string fileContent = File.ReadAllText(filePath); SaveStruct saveData = JsonUtility.FromJson(fileContent); // todo: put the saved nodes and nodes into the world diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index dfa40a3..ce92eb6 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -331,94 +331,6 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 267250012} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &349804698 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 349804699} - - component: {fileID: 349804700} - m_Layer: 0 - m_Name: exit1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &349804699 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 349804698} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -10, y: 0, z: 2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &349804700 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 349804698} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} ---- !u!1 &496844663 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 496844664} - - component: {fileID: 496844665} - m_Layer: 0 - m_Name: exit2 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &496844664 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 496844663} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -2, y: 0, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &496844665 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 496844663} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} --- !u!1 &555903562 GameObject: m_ObjectHideFlags: 0 @@ -585,44 +497,6 @@ m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &616330206 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 616330207} - m_Layer: 0 - m_Name: Level - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &616330207 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 616330206} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.5, y: 1.5, z: 1.5} - m_Children: - - {fileID: 2127136780} - - {fileID: 1238973364} - - {fileID: 1380320608} - - {fileID: 1720606668} - - {fileID: 349804699} - - {fileID: 496844664} - - {fileID: 1551909213} - - {fileID: 861726357} - m_Father: {fileID: 0} - m_RootOrder: 8 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &705507993 GameObject: m_ObjectHideFlags: 0 @@ -716,50 +590,6 @@ m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1 &861726356 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 861726357} - - component: {fileID: 861726358} - m_Layer: 0 - m_Name: exit4 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &861726357 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 861726356} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2, y: 0, z: 10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 7 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &861726358 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 861726356} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} --- !u!1 &887232955 GameObject: m_ObjectHideFlags: 0 @@ -1268,56 +1098,6 @@ m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} ---- !u!1 &1238973363 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1238973364} - - component: {fileID: 1238973365} - m_Layer: 0 - m_Name: spawn2 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1238973364 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1238973363} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2, y: 0, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1238973365 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1238973363} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 349804700} - - {fileID: 1551909214} - - {fileID: 861726358} - timeLeft: 0 - interval: 2 --- !u!1 &1256630289 GameObject: m_ObjectHideFlags: 0 @@ -1447,100 +1227,6 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1331646751} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &1380320607 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1380320608} - - component: {fileID: 1380320609} - m_Layer: 0 - m_Name: spawn3 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1380320608 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1380320607} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 10, y: 0, z: 2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1380320609 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1380320607} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 349804700} - - {fileID: 496844665} - - {fileID: 861726358} - timeLeft: 0 - interval: 2 ---- !u!1 &1551909212 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1551909213} - - component: {fileID: 1551909214} - m_Layer: 0 - m_Name: exit3 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1551909213 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1551909212} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 10, y: 0, z: -2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1551909214 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1551909212} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} --- !u!1 &1621584771 GameObject: m_ObjectHideFlags: 0 @@ -1724,56 +1410,6 @@ material: {fileID: 2100000, guid: e2c5b6e79b6cdb545863f245ced42125, type: 2} config: {fileID: 128843415} drawMode: 0 ---- !u!1 &1720606667 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1720606668} - - component: {fileID: 1720606669} - m_Layer: 0 - m_Name: spawn4 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1720606668 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1720606667} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -2, y: 0, z: 10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1720606669 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1720606667} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 349804700} - - {fileID: 496844665} - - {fileID: 1551909214} - timeLeft: 0 - interval: 2 --- !u!1 &1812881467 GameObject: m_ObjectHideFlags: 0 @@ -1908,53 +1544,3 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1812881467} m_CullTransparentMesh: 1 ---- !u!1 &2127136779 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2127136780} - - component: {fileID: 2127136781} - m_Layer: 0 - m_Name: spawn1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2127136780 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2127136779} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -10, y: 0, z: -2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &2127136781 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2127136779} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 1551909214} - - {fileID: 496844665} - - {fileID: 861726358} - timeLeft: 0 - interval: 2 diff --git a/Assets/Scripts/Buttons/LoadButton.cs b/Assets/Scripts/Buttons/LoadButton.cs index 2724452..a9044e1 100644 --- a/Assets/Scripts/Buttons/LoadButton.cs +++ b/Assets/Scripts/Buttons/LoadButton.cs @@ -17,7 +17,7 @@ if (filePath.Length == 0) { return; } - // todo: clear scene of all currently build nodes and roads and ensure Config.roadNetwork is empty + config.roadNetwork.clear(); string fileContent = File.ReadAllText(filePath); SaveStruct saveData = JsonUtility.FromJson(fileContent); // todo: put the saved nodes and nodes into the world diff --git a/Assets/Scripts/Roads/Node/CustomNode.cs b/Assets/Scripts/Roads/Node/CustomNode.cs index f4a1eff..acf79e5 100644 --- a/Assets/Scripts/Roads/Node/CustomNode.cs +++ b/Assets/Scripts/Roads/Node/CustomNode.cs @@ -7,11 +7,7 @@ } override public void delete() { - foreach (Road road in roads) { - road.nodes.Remove(this); - road.delete(); - } - GameObject.Destroy(gameObject); + forceDelete(); } override public void pull(Vector3 position) { diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index dfa40a3..ce92eb6 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -331,94 +331,6 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 267250012} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &349804698 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 349804699} - - component: {fileID: 349804700} - m_Layer: 0 - m_Name: exit1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &349804699 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 349804698} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -10, y: 0, z: 2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &349804700 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 349804698} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} ---- !u!1 &496844663 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 496844664} - - component: {fileID: 496844665} - m_Layer: 0 - m_Name: exit2 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &496844664 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 496844663} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -2, y: 0, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &496844665 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 496844663} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} --- !u!1 &555903562 GameObject: m_ObjectHideFlags: 0 @@ -585,44 +497,6 @@ m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &616330206 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 616330207} - m_Layer: 0 - m_Name: Level - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &616330207 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 616330206} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.5, y: 1.5, z: 1.5} - m_Children: - - {fileID: 2127136780} - - {fileID: 1238973364} - - {fileID: 1380320608} - - {fileID: 1720606668} - - {fileID: 349804699} - - {fileID: 496844664} - - {fileID: 1551909213} - - {fileID: 861726357} - m_Father: {fileID: 0} - m_RootOrder: 8 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &705507993 GameObject: m_ObjectHideFlags: 0 @@ -716,50 +590,6 @@ m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1 &861726356 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 861726357} - - component: {fileID: 861726358} - m_Layer: 0 - m_Name: exit4 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &861726357 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 861726356} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2, y: 0, z: 10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 7 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &861726358 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 861726356} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} --- !u!1 &887232955 GameObject: m_ObjectHideFlags: 0 @@ -1268,56 +1098,6 @@ m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} ---- !u!1 &1238973363 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1238973364} - - component: {fileID: 1238973365} - m_Layer: 0 - m_Name: spawn2 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1238973364 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1238973363} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2, y: 0, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1238973365 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1238973363} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 349804700} - - {fileID: 1551909214} - - {fileID: 861726358} - timeLeft: 0 - interval: 2 --- !u!1 &1256630289 GameObject: m_ObjectHideFlags: 0 @@ -1447,100 +1227,6 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1331646751} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &1380320607 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1380320608} - - component: {fileID: 1380320609} - m_Layer: 0 - m_Name: spawn3 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1380320608 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1380320607} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 10, y: 0, z: 2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1380320609 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1380320607} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 349804700} - - {fileID: 496844665} - - {fileID: 861726358} - timeLeft: 0 - interval: 2 ---- !u!1 &1551909212 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1551909213} - - component: {fileID: 1551909214} - m_Layer: 0 - m_Name: exit3 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1551909213 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1551909212} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 10, y: 0, z: -2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1551909214 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1551909212} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} --- !u!1 &1621584771 GameObject: m_ObjectHideFlags: 0 @@ -1724,56 +1410,6 @@ material: {fileID: 2100000, guid: e2c5b6e79b6cdb545863f245ced42125, type: 2} config: {fileID: 128843415} drawMode: 0 ---- !u!1 &1720606667 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1720606668} - - component: {fileID: 1720606669} - m_Layer: 0 - m_Name: spawn4 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1720606668 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1720606667} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -2, y: 0, z: 10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1720606669 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1720606667} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 349804700} - - {fileID: 496844665} - - {fileID: 1551909214} - timeLeft: 0 - interval: 2 --- !u!1 &1812881467 GameObject: m_ObjectHideFlags: 0 @@ -1908,53 +1544,3 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1812881467} m_CullTransparentMesh: 1 ---- !u!1 &2127136779 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2127136780} - - component: {fileID: 2127136781} - m_Layer: 0 - m_Name: spawn1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2127136780 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2127136779} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -10, y: 0, z: -2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &2127136781 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2127136779} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 1551909214} - - {fileID: 496844665} - - {fileID: 861726358} - timeLeft: 0 - interval: 2 diff --git a/Assets/Scripts/Buttons/LoadButton.cs b/Assets/Scripts/Buttons/LoadButton.cs index 2724452..a9044e1 100644 --- a/Assets/Scripts/Buttons/LoadButton.cs +++ b/Assets/Scripts/Buttons/LoadButton.cs @@ -17,7 +17,7 @@ if (filePath.Length == 0) { return; } - // todo: clear scene of all currently build nodes and roads and ensure Config.roadNetwork is empty + config.roadNetwork.clear(); string fileContent = File.ReadAllText(filePath); SaveStruct saveData = JsonUtility.FromJson(fileContent); // todo: put the saved nodes and nodes into the world diff --git a/Assets/Scripts/Roads/Node/CustomNode.cs b/Assets/Scripts/Roads/Node/CustomNode.cs index f4a1eff..acf79e5 100644 --- a/Assets/Scripts/Roads/Node/CustomNode.cs +++ b/Assets/Scripts/Roads/Node/CustomNode.cs @@ -7,11 +7,7 @@ } override public void delete() { - foreach (Road road in roads) { - road.nodes.Remove(this); - road.delete(); - } - GameObject.Destroy(gameObject); + forceDelete(); } override public void pull(Vector3 position) { diff --git a/Assets/Scripts/Roads/Node/Node.cs b/Assets/Scripts/Roads/Node/Node.cs index e303086..7eda931 100644 --- a/Assets/Scripts/Roads/Node/Node.cs +++ b/Assets/Scripts/Roads/Node/Node.cs @@ -109,4 +109,12 @@ } public abstract void delete(); + + public void forceDelete() { + foreach (Road road in roads) { + road.nodes.Remove(this); + road.delete(); + } + GameObject.Destroy(gameObject); + } } diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index dfa40a3..ce92eb6 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -331,94 +331,6 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 267250012} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &349804698 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 349804699} - - component: {fileID: 349804700} - m_Layer: 0 - m_Name: exit1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &349804699 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 349804698} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -10, y: 0, z: 2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &349804700 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 349804698} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} ---- !u!1 &496844663 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 496844664} - - component: {fileID: 496844665} - m_Layer: 0 - m_Name: exit2 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &496844664 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 496844663} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -2, y: 0, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &496844665 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 496844663} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} --- !u!1 &555903562 GameObject: m_ObjectHideFlags: 0 @@ -585,44 +497,6 @@ m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &616330206 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 616330207} - m_Layer: 0 - m_Name: Level - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &616330207 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 616330206} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.5, y: 1.5, z: 1.5} - m_Children: - - {fileID: 2127136780} - - {fileID: 1238973364} - - {fileID: 1380320608} - - {fileID: 1720606668} - - {fileID: 349804699} - - {fileID: 496844664} - - {fileID: 1551909213} - - {fileID: 861726357} - m_Father: {fileID: 0} - m_RootOrder: 8 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &705507993 GameObject: m_ObjectHideFlags: 0 @@ -716,50 +590,6 @@ m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1 &861726356 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 861726357} - - component: {fileID: 861726358} - m_Layer: 0 - m_Name: exit4 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &861726357 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 861726356} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2, y: 0, z: 10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 7 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &861726358 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 861726356} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} --- !u!1 &887232955 GameObject: m_ObjectHideFlags: 0 @@ -1268,56 +1098,6 @@ m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} ---- !u!1 &1238973363 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1238973364} - - component: {fileID: 1238973365} - m_Layer: 0 - m_Name: spawn2 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1238973364 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1238973363} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2, y: 0, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1238973365 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1238973363} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 349804700} - - {fileID: 1551909214} - - {fileID: 861726358} - timeLeft: 0 - interval: 2 --- !u!1 &1256630289 GameObject: m_ObjectHideFlags: 0 @@ -1447,100 +1227,6 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1331646751} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &1380320607 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1380320608} - - component: {fileID: 1380320609} - m_Layer: 0 - m_Name: spawn3 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1380320608 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1380320607} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 10, y: 0, z: 2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1380320609 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1380320607} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 349804700} - - {fileID: 496844665} - - {fileID: 861726358} - timeLeft: 0 - interval: 2 ---- !u!1 &1551909212 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1551909213} - - component: {fileID: 1551909214} - m_Layer: 0 - m_Name: exit3 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1551909213 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1551909212} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 10, y: 0, z: -2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1551909214 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1551909212} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 42b9d9ab3d3a7f54390b6f12f991b39d, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} --- !u!1 &1621584771 GameObject: m_ObjectHideFlags: 0 @@ -1724,56 +1410,6 @@ material: {fileID: 2100000, guid: e2c5b6e79b6cdb545863f245ced42125, type: 2} config: {fileID: 128843415} drawMode: 0 ---- !u!1 &1720606667 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1720606668} - - component: {fileID: 1720606669} - m_Layer: 0 - m_Name: spawn4 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1720606668 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1720606667} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -2, y: 0, z: 10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1720606669 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1720606667} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 349804700} - - {fileID: 496844665} - - {fileID: 1551909214} - timeLeft: 0 - interval: 2 --- !u!1 &1812881467 GameObject: m_ObjectHideFlags: 0 @@ -1908,53 +1544,3 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1812881467} m_CullTransparentMesh: 1 ---- !u!1 &2127136779 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2127136780} - - component: {fileID: 2127136781} - m_Layer: 0 - m_Name: spawn1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2127136780 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2127136779} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -10, y: 0, z: -2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 616330207} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &2127136781 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2127136779} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 71fd0b84cdaf65f48998acd1412e970e, type: 3} - m_Name: - m_EditorClassIdentifier: - config: {fileID: 128843415} - targets: - - {fileID: 1551909214} - - {fileID: 496844665} - - {fileID: 861726358} - timeLeft: 0 - interval: 2 diff --git a/Assets/Scripts/Buttons/LoadButton.cs b/Assets/Scripts/Buttons/LoadButton.cs index 2724452..a9044e1 100644 --- a/Assets/Scripts/Buttons/LoadButton.cs +++ b/Assets/Scripts/Buttons/LoadButton.cs @@ -17,7 +17,7 @@ if (filePath.Length == 0) { return; } - // todo: clear scene of all currently build nodes and roads and ensure Config.roadNetwork is empty + config.roadNetwork.clear(); string fileContent = File.ReadAllText(filePath); SaveStruct saveData = JsonUtility.FromJson(fileContent); // todo: put the saved nodes and nodes into the world diff --git a/Assets/Scripts/Roads/Node/CustomNode.cs b/Assets/Scripts/Roads/Node/CustomNode.cs index f4a1eff..acf79e5 100644 --- a/Assets/Scripts/Roads/Node/CustomNode.cs +++ b/Assets/Scripts/Roads/Node/CustomNode.cs @@ -7,11 +7,7 @@ } override public void delete() { - foreach (Road road in roads) { - road.nodes.Remove(this); - road.delete(); - } - GameObject.Destroy(gameObject); + forceDelete(); } override public void pull(Vector3 position) { diff --git a/Assets/Scripts/Roads/Node/Node.cs b/Assets/Scripts/Roads/Node/Node.cs index e303086..7eda931 100644 --- a/Assets/Scripts/Roads/Node/Node.cs +++ b/Assets/Scripts/Roads/Node/Node.cs @@ -109,4 +109,12 @@ } public abstract void delete(); + + public void forceDelete() { + foreach (Road road in roads) { + road.nodes.Remove(this); + road.delete(); + } + GameObject.Destroy(gameObject); + } } diff --git a/Assets/Scripts/Roads/RoadNetwork.cs b/Assets/Scripts/Roads/RoadNetwork.cs index ca0badb..888aa5b 100644 --- a/Assets/Scripts/Roads/RoadNetwork.cs +++ b/Assets/Scripts/Roads/RoadNetwork.cs @@ -7,4 +7,16 @@ public class RoadNetwork { public List nodes = new List(); public List roads = new List(); + + public void clear() { + + foreach (Road road in roads) { + road.delete(); + } + roads.Clear(); + foreach (Node node in nodes) { + node.forceDelete(); + } + nodes.Clear(); + } }