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: