Add a very basic game example (A winner is you)

This commit is contained in:
Gabriel Le Breton
2020-10-08 10:26:03 -04:00
parent 5d0caa67cb
commit d8a020a4d6
5 changed files with 732 additions and 16 deletions
+20
View File
@@ -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();
}
}
}