Removing barriers, adding trick logic, and making players pick-up-able
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class TrickCollisionManager : MonoBehaviour
|
||||
{
|
||||
private bool initialized;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
if (initialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var trickLayer = LayerMask.NameToLayer("Trick");
|
||||
if (trickLayer == -1)
|
||||
{
|
||||
Debug.LogWarning("Trick layer not found. Create a layer named 'Trick' and assign it to Trick prefab.");
|
||||
return;
|
||||
}
|
||||
|
||||
Physics2D.IgnoreLayerCollision(trickLayer, trickLayer, true);
|
||||
initialized = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user