diff --git a/Assembly-CSharp.csproj b/Assembly-CSharp.csproj
index 714020cf..ef3b5986 100644
--- a/Assembly-CSharp.csproj
+++ b/Assembly-CSharp.csproj
@@ -57,6 +57,7 @@
+
diff --git a/Assets/Scenes/CaveEntrance.unity b/Assets/Scenes/CaveEntrance.unity
index 93657dd9..5e557b59 100644
--- a/Assets/Scenes/CaveEntrance.unity
+++ b/Assets/Scenes/CaveEntrance.unity
@@ -173,6 +173,7 @@ GameObject:
- component: {fileID: 167690938}
- component: {fileID: 167690943}
- component: {fileID: 167690944}
+ - component: {fileID: 167690945}
m_Layer: 0
m_Name: mainCh_standing
m_TagString: Player
@@ -339,6 +340,18 @@ Animator:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
+--- !u!114 &167690945
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 167690937}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 48a2ec1fec857c946ae3ae8e69b29562, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
--- !u!1 &519420028
GameObject:
m_ObjectHideFlags: 0
@@ -51475,6 +51488,99 @@ Tilemap:
e31: 0
e32: 0
e33: 1
+--- !u!1 &1193017321
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 1193017325}
+ - component: {fileID: 1193017324}
+ - component: {fileID: 1193017323}
+ - component: {fileID: 1193017322}
+ m_Layer: 0
+ m_Name: Door
+ m_TagString: SceneTransition
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!114 &1193017322
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1193017321}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: d7edafbad889ba34e9aae593d927c3a5, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ SceneName: SampleScene
+--- !u!50 &1193017323
+Rigidbody2D:
+ serializedVersion: 4
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1193017321}
+ m_BodyType: 0
+ m_Simulated: 1
+ m_UseFullKinematicContacts: 0
+ m_UseAutoMass: 0
+ m_Mass: 1
+ m_LinearDrag: 0
+ m_AngularDrag: 0.05
+ m_GravityScale: 0
+ m_Material: {fileID: 0}
+ m_Interpolate: 0
+ m_SleepingMode: 1
+ m_CollisionDetection: 0
+ m_Constraints: 0
+--- !u!61 &1193017324
+BoxCollider2D:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1193017321}
+ m_Enabled: 1
+ m_Density: 1
+ m_Material: {fileID: 0}
+ m_IsTrigger: 0
+ m_UsedByEffector: 0
+ m_UsedByComposite: 0
+ m_Offset: {x: 0, y: 0}
+ m_SpriteTilingProperty:
+ border: {x: 0, y: 0, z: 0, w: 0}
+ pivot: {x: 0, y: 0}
+ oldSize: {x: 0, y: 0}
+ newSize: {x: 0, y: 0}
+ adaptiveTilingThreshold: 0
+ drawMode: 0
+ adaptiveTiling: 0
+ m_AutoTiling: 0
+ serializedVersion: 2
+ m_Size: {x: 1, y: 1}
+ m_EdgeRadius: 0
+--- !u!4 &1193017325
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1193017321}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0.55, y: -10.48, z: 0}
+ m_LocalScale: {x: 1.975, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 3
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1193056560
GameObject:
m_ObjectHideFlags: 0
diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity
index 46e8a66b..5c0e91d6 100644
--- a/Assets/Scenes/SampleScene.unity
+++ b/Assets/Scenes/SampleScene.unity
@@ -780,6 +780,7 @@ GameObject:
- component: {fileID: 167690938}
- component: {fileID: 167690943}
- component: {fileID: 167690944}
+ - component: {fileID: 167690945}
m_Layer: 0
m_Name: mainCh_standing
m_TagString: Player
@@ -946,6 +947,18 @@ Animator:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
+--- !u!114 &167690945
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 167690937}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 48a2ec1fec857c946ae3ae8e69b29562, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
--- !u!1 &184660452
GameObject:
m_ObjectHideFlags: 0
@@ -91204,6 +91217,99 @@ Transform:
m_Father: {fileID: 166697418}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &2020454682
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 2020454686}
+ - component: {fileID: 2020454685}
+ - component: {fileID: 2020454684}
+ - component: {fileID: 2020454683}
+ m_Layer: 0
+ m_Name: Door
+ m_TagString: SceneTransition
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!114 &2020454683
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2020454682}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: d7edafbad889ba34e9aae593d927c3a5, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ SceneName: CaveEntrance
+--- !u!50 &2020454684
+Rigidbody2D:
+ serializedVersion: 4
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2020454682}
+ m_BodyType: 0
+ m_Simulated: 1
+ m_UseFullKinematicContacts: 0
+ m_UseAutoMass: 0
+ m_Mass: 1
+ m_LinearDrag: 0
+ m_AngularDrag: 0.05
+ m_GravityScale: 0
+ m_Material: {fileID: 0}
+ m_Interpolate: 0
+ m_SleepingMode: 1
+ m_CollisionDetection: 0
+ m_Constraints: 0
+--- !u!61 &2020454685
+BoxCollider2D:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2020454682}
+ m_Enabled: 1
+ m_Density: 1
+ m_Material: {fileID: 0}
+ m_IsTrigger: 0
+ m_UsedByEffector: 0
+ m_UsedByComposite: 0
+ m_Offset: {x: 0, y: 0}
+ m_SpriteTilingProperty:
+ border: {x: 0, y: 0, z: 0, w: 0}
+ pivot: {x: 0, y: 0}
+ oldSize: {x: 0, y: 0}
+ newSize: {x: 0, y: 0}
+ adaptiveTilingThreshold: 0
+ drawMode: 0
+ adaptiveTiling: 0
+ m_AutoTiling: 0
+ serializedVersion: 2
+ m_Size: {x: 1, y: 1}
+ m_EdgeRadius: 0
+--- !u!4 &2020454686
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2020454682}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: -0.01, y: -6.48, z: 0}
+ m_LocalScale: {x: 1.975, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 9
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2060891297
GameObject:
m_ObjectHideFlags: 0
diff --git a/Assets/Scripts/ChangeScene.cs b/Assets/Scripts/ChangeScene.cs
index 2bb6f962..1828c47c 100644
--- a/Assets/Scripts/ChangeScene.cs
+++ b/Assets/Scripts/ChangeScene.cs
@@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
+using System;
public class ChangeScene : MonoBehaviour
{
@@ -9,4 +10,12 @@ public class ChangeScene : MonoBehaviour
{
SceneManager.LoadScene(sceneID);
}
+
+ public void OnCollisionEnter2D(Collision2D collision)
+ {
+ if(collision.gameObject.tag == "SceneTransition")
+ {
+ DoorBehaviour.Instance.ScenetToMoveTo();
+ }
+ }
}
diff --git a/Assets/Scripts/DoorBehaviour.cs b/Assets/Scripts/DoorBehaviour.cs
new file mode 100644
index 00000000..1254f1c0
--- /dev/null
+++ b/Assets/Scripts/DoorBehaviour.cs
@@ -0,0 +1,38 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.SceneManagement;
+
+public class DoorBehaviour : MonoBehaviour
+{
+ public static DoorBehaviour Instance;
+ public string SceneName = "SampleScene";
+
+ private void Awake()
+ {
+ if(Instance == null)
+ {
+ Instance = this;
+ }else if (Instance != this)
+ {
+ Destroy(gameObject);
+ }
+ }
+
+ // Start is called before the first frame update
+ void Start()
+ {
+
+ }
+
+ // Update is called once per frame
+ void Update()
+ {
+
+ }
+
+ public void ScenetToMoveTo()
+ {
+ SceneManager.LoadScene(this.SceneName);
+ }
+}
diff --git a/Assets/Scripts/DoorBehaviour.cs.meta b/Assets/Scripts/DoorBehaviour.cs.meta
new file mode 100644
index 00000000..48e3176b
--- /dev/null
+++ b/Assets/Scripts/DoorBehaviour.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d7edafbad889ba34e9aae593d927c3a5
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset
index 44dc3ea5..7bacf24c 100644
--- a/ProjectSettings/EditorBuildSettings.asset
+++ b/ProjectSettings/EditorBuildSettings.asset
@@ -23,4 +23,7 @@ EditorBuildSettings:
- enabled: 1
path: Assets/Scenes/SampleScene.unity
guid: 2cda990e2423bbf4892e6590ba056729
+ - enabled: 1
+ path: Assets/Scenes/CaveEntrance.unity
+ guid: 58d5d2c3457391e428ae5617f22e2cfd
m_configObjects: {}
diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset
index d4d910ab..25f496cd 100644
--- a/UserSettings/EditorUserSettings.asset
+++ b/UserSettings/EditorUserSettings.asset
@@ -21,10 +21,10 @@ EditorUserSettings:
value: 22424703114646680e0b0227036c72111f19352f223d667d6d051c3de5f5353fe7a923e7ee2e26
flags: 0
RecentlyUsedScenePath-5:
- value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d
+ value: 22424703114646680e0b0227036c7c1100123d24383a273e2e2c5326ece92021
flags: 0
RecentlyUsedScenePath-6:
- value: 22424703114646680e0b0227036c7c1100123d24383a273e2e2c5326ece92021
+ value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650