Soft Lock preventer

This commit is contained in:
DominikB 2023-06-22 11:07:25 +02:00
parent 2bc4acf624
commit c8d0024841
6 changed files with 380 additions and 5 deletions

View File

@ -28,6 +28,7 @@ public class BoulderFix : MonoBehaviour
void OnCollisionEnter2D(Collision2D col)
{
bc.sharedMaterial = frictionless;
rb.drag = 3;
@ -40,4 +41,6 @@ public class BoulderFix : MonoBehaviour
}
}

View File

@ -0,0 +1,39 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SoftLockPreventer : MonoBehaviour
{
public GameObject toDeactivate;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnTriggerEnter2D(Collider2D other)
{
Debug.Log("SoftLockPreventer: Deactivated");
if (other.gameObject.CompareTag("Player"))
{
toDeactivate.SetActive(false);
}
}
private void OnTriggerExit2D(Collider2D other)
{
Debug.Log("SoftLockPreventer: Activated");
if (other.gameObject.CompareTag("Player"))
{
toDeactivate.SetActive(true);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 14bd808cbf3154cf69653b828def20bb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -153,7 +153,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 13af0af2052bc354cbdcc5815507a4fe, type: 3}
m_Name:
m_EditorClassIdentifier:
player: {fileID: 1535821428}
respawnPoint: {fileID: 71726988}
--- !u!61 &32937241
BoxCollider2D:
@ -6179,7 +6178,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 13af0af2052bc354cbdcc5815507a4fe, type: 3}
m_Name:
m_EditorClassIdentifier:
player: {fileID: 1535821428}
respawnPoint: {fileID: 2046905599}
--- !u!61 &648447528
BoxCollider2D:
@ -8125,7 +8123,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 13af0af2052bc354cbdcc5815507a4fe, type: 3}
m_Name:
m_EditorClassIdentifier:
player: {fileID: 1535821428}
respawnPoint: {fileID: 548313697}
--- !u!61 &747507368
BoxCollider2D:
@ -8198,7 +8195,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 13af0af2052bc354cbdcc5815507a4fe, type: 3}
m_Name:
m_EditorClassIdentifier:
player: {fileID: 1535821428}
respawnPoint: {fileID: 465821332}
--- !u!61 &782810835
BoxCollider2D:
@ -8887,6 +8883,79 @@ Transform:
m_CorrespondingSourceObject: {fileID: 5311324458996372741, guid: 525621658d61b09439b07a6c216a3d3a, type: 3}
m_PrefabInstance: {fileID: 785324695}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1035310642
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1035310643}
- component: {fileID: 1035310645}
- component: {fileID: 1035310644}
m_Layer: 0
m_Name: Master
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1035310643
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1035310642}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -1.76, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2012285873}
m_Father: {fileID: 1558493468}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &1035310644
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1035310642}
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}
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!114 &1035310645
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1035310642}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 14bd808cbf3154cf69653b828def20bb, type: 3}
m_Name:
m_EditorClassIdentifier:
toDeactivate: {fileID: 2012285872}
--- !u!1 &1048992109
GameObject:
m_ObjectHideFlags: 0
@ -15635,6 +15704,38 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 2410396854066836738, guid: 22badd0525f460b4d988841429f6a07e, type: 3}
m_PrefabInstance: {fileID: 448203240}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1558493467
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1558493468}
m_Layer: 0
m_Name: SoftLockPreventer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1558493468
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1558493467}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 51.2, y: -2.7, z: -1.2964574}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1035310643}
m_Father: {fileID: 0}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &1566215007 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 2266354577234420971, guid: 3a46426863c78f848be701c60cf48712, type: 3}
@ -19294,6 +19395,64 @@ Tilemap:
e31: 0
e32: 0
e33: 1
--- !u!1 &2012285872
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2012285873}
- component: {fileID: 2012285874}
m_Layer: 0
m_Name: Slave
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2012285873
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2012285872}
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: 1035310643}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &2012285874
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2012285872}
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!1 &2014833041
GameObject:
m_ObjectHideFlags: 0

View File

@ -1051,6 +1051,64 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &558281791
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 558281792}
- component: {fileID: 558281793}
m_Layer: 0
m_Name: Slave
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &558281792
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 558281791}
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: 1637309263}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &558281793
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 558281791}
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!1001 &576363002
PrefabInstance:
m_ObjectHideFlags: 0
@ -1845,6 +1903,38 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &1138764301
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1138764302}
m_Layer: 0
m_Name: SoftLockPreventer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1138764302
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1138764301}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -11.868802, y: -0.77036583, z: -1.2964574}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1637309263}
m_Father: {fileID: 0}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1194625811
GameObject:
m_ObjectHideFlags: 0
@ -2221,7 +2311,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e4ea2b46765b2a94c81f15618d3ea519, type: 3}
m_Name:
m_EditorClassIdentifier:
_LevelManager1: {fileID: 1336267132}
isFalling: 0
counter: 0
--- !u!114 &1336267144
@ -2560,6 +2649,79 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &1637309262
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1637309263}
- component: {fileID: 1637309266}
- component: {fileID: 1637309265}
m_Layer: 0
m_Name: Master
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1637309263
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1637309262}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -1.76, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 558281792}
m_Father: {fileID: 1138764302}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &1637309265
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1637309262}
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}
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!114 &1637309266
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1637309262}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 14bd808cbf3154cf69653b828def20bb, type: 3}
m_Name:
m_EditorClassIdentifier:
toDeactivate: {fileID: 558281791}
--- !u!1 &1681817730
GameObject:
m_ObjectHideFlags: 0

View File

@ -10,6 +10,7 @@ TagManager:
- Openable
- SceneChanger
- DimShiftBlocker
- SoftLock
layers:
- Default
- TransparentFX