Created
October 26, 2019 17:48
-
-
Save jm/33f668b88ac7d3fc34577c931d83c5c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.Events; | |
[AddComponentMenu("Playground/Conditions/Condition Collision")] | |
[RequireComponent(typeof(Collider))] | |
public class ConditionCollision : ConditionBase | |
{ | |
// This function will be called when something touches the trigger collider | |
void OnCollisionEnter(Collision collision) | |
{ | |
if(collision.collider.CompareTag(filterTag) | |
|| !filterByTag) | |
{ | |
ExecuteAllActions(collision.gameObject); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment