mirror of
https://github.com/OMGeeky/GameDevGameJamV2.git
synced 2025-12-31 00:30:11 +01:00
Initial commit
This commit is contained in:
20
Assets/Scripts/DissolveCollidersExceptPlayer.cs
Normal file
20
Assets/Scripts/DissolveCollidersExceptPlayer.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
public class DissolveCollidersExceptPlayer : MonoBehaviour
|
||||
{
|
||||
private void OnTriggerEnter2D( Collider2D col )
|
||||
{
|
||||
if ( !col.TryGetComponent( out Character character ) )
|
||||
return;
|
||||
|
||||
if ( character.isActivePlayer )
|
||||
return;
|
||||
|
||||
character.DissolveSelf();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user