Skip to content

Commit

Permalink
Level Loading
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsZauberer committed Feb 12, 2021
1 parent cf40161 commit 9d7bbf2
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 2 deletions.
73 changes: 73 additions & 0 deletions Assets/Prefabs/Level Loader.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3427948640443327690
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3427948640443327689}
- component: {fileID: 3427948640443327688}
- component: {fileID: 3427948640443327691}
m_Layer: 0
m_Name: Level Loader
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3427948640443327689
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3427948640443327690}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 12.77, y: 2.8802893, z: -53.599636}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &3427948640443327688
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3427948640443327690}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: -0.5651361}
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: 4.3908195}
m_EdgeRadius: 0
--- !u!114 &3427948640443327691
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3427948640443327690}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 15f18ffda70bb6641a952dd3224f2584, type: 3}
m_Name:
m_EditorClassIdentifier:
nextLevel: SampleScene
7 changes: 7 additions & 0 deletions Assets/Prefabs/Level Loader.prefab.meta

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

73 changes: 71 additions & 2 deletions Assets/Scenes/SampleScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -4534,7 +4534,7 @@ GameObject:
- component: {fileID: 1551824128}
m_Layer: 0
m_Name: Player
m_TagString: Untagged
m_TagString: Player
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
Expand Down Expand Up @@ -5309,7 +5309,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1963319080}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 9.23, y: 2.22, z: 0}
m_LocalPosition: {x: 9.21, y: 2.32, z: 0}
m_LocalScale: {x: 0.75, y: 0.75, z: 1}
m_Children: []
m_Father: {fileID: 0}
Expand Down Expand Up @@ -5400,6 +5400,75 @@ MonoBehaviour:
m_BoundingShape2D: {fileID: 1586489445}
m_ConfineScreenEdges: 1
m_Damping: 0
--- !u!1001 &3427948639706760606
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3427948640443327689, guid: 0a7d3fa94abdbc342bd6e88b4643c36e,
type: 3}
propertyPath: m_RootOrder
value: 9
objectReference: {fileID: 0}
- target: {fileID: 3427948640443327689, guid: 0a7d3fa94abdbc342bd6e88b4643c36e,
type: 3}
propertyPath: m_LocalPosition.x
value: 12.77
objectReference: {fileID: 0}
- target: {fileID: 3427948640443327689, guid: 0a7d3fa94abdbc342bd6e88b4643c36e,
type: 3}
propertyPath: m_LocalPosition.y
value: 2.8802893
objectReference: {fileID: 0}
- target: {fileID: 3427948640443327689, guid: 0a7d3fa94abdbc342bd6e88b4643c36e,
type: 3}
propertyPath: m_LocalPosition.z
value: -53.599636
objectReference: {fileID: 0}
- target: {fileID: 3427948640443327689, guid: 0a7d3fa94abdbc342bd6e88b4643c36e,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3427948640443327689, guid: 0a7d3fa94abdbc342bd6e88b4643c36e,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3427948640443327689, guid: 0a7d3fa94abdbc342bd6e88b4643c36e,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3427948640443327689, guid: 0a7d3fa94abdbc342bd6e88b4643c36e,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3427948640443327689, guid: 0a7d3fa94abdbc342bd6e88b4643c36e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3427948640443327689, guid: 0a7d3fa94abdbc342bd6e88b4643c36e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3427948640443327689, guid: 0a7d3fa94abdbc342bd6e88b4643c36e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3427948640443327690, guid: 0a7d3fa94abdbc342bd6e88b4643c36e,
type: 3}
propertyPath: m_Name
value: Level Loader
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0a7d3fa94abdbc342bd6e88b4643c36e, type: 3}
--- !u!1001 &7188535335816162300
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
13 changes: 13 additions & 0 deletions Assets/Scripts/Objects/LevelLoading.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class LevelLoading : MonoBehaviour
{
public string nextLevel;
private void OnTriggerEnter2D(Collider2D other) {
if (other.gameObject.tag == "Player")
SceneManager.LoadScene(nextLevel);
}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/Objects/LevelLoading.cs.meta

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

0 comments on commit 9d7bbf2

Please sign in to comment.