Soft Lock preventer
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
39
Assets/AssetsFORELLE/Script/SoftLockPreventer.cs
Normal file
39
Assets/AssetsFORELLE/Script/SoftLockPreventer.cs
Normal 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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/AssetsFORELLE/Script/SoftLockPreventer.cs.meta
generated
Normal file
11
Assets/AssetsFORELLE/Script/SoftLockPreventer.cs.meta
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 14bd808cbf3154cf69653b828def20bb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user