Move scripts to Scripts folder
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
public class OnCollisionEnterEvent : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private UnityEvent @event;
|
||||
[SerializeField] private string otherGameObjectName = "Sphere";
|
||||
|
||||
private void OnCollisionEnter(Collision other)
|
||||
{
|
||||
if (other.gameObject.name == otherGameObjectName)
|
||||
{
|
||||
@event.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user