Created
October 26, 2019 17:48
-
-
Save jm/33f668b88ac7d3fc34577c931d83c5c0 to your computer and use it in GitHub Desktop.
Revisions
-
jm created this gist
Oct 26, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ 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); } } }