diff --git a/Assets/Actors/Automatic/Firehydrant/firehydrant.cs b/Assets/Actors/Automatic/Firehydrant/firehydrant.cs new file mode 100644 index 0000000..6351860 --- /dev/null +++ b/Assets/Actors/Automatic/Firehydrant/firehydrant.cs @@ -0,0 +1,19 @@ +using UnityEngine; + +public class firehydrant : MonoBehaviour +{ + // Start is called once before the first execution of Update after the MonoBehaviour is created + void Start() + { + } + + // Update is called once per frame + void Update() + { + } + + void OnCollisionEnter(Collision _) + { + events.PubCollision(); + } +} diff --git a/Assets/Actors/Automatic/Firehydrant/firehydrant.cs.meta b/Assets/Actors/Automatic/Firehydrant/firehydrant.cs.meta new file mode 100644 index 0000000..c5aa20e --- /dev/null +++ b/Assets/Actors/Automatic/Firehydrant/firehydrant.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f63a4aa77aafd2b12a2554da4978087c \ No newline at end of file diff --git a/Assets/Actors/Controllable/Car/Car.prefab b/Assets/Actors/Controllable/Car/Car.prefab index ef30954..8d7f470 100644 --- a/Assets/Actors/Controllable/Car/Car.prefab +++ b/Assets/Actors/Controllable/Car/Car.prefab @@ -887,6 +887,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} insertIndex: -1 addedObject: {fileID: 1972229520404947818} + - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + insertIndex: -1 + addedObject: {fileID: 6825522030758200062} - targetCorrespondingSourceObject: {fileID: -5287916851642620284, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} insertIndex: -1 addedObject: {fileID: 2634568116272046903} @@ -982,6 +985,18 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 25bb371d44866654297937bd67a261d4, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &6825522030758200062 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1493955717807061527} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dff7018aae93db1aea5d93f82f4abdcd, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!4 &2242921521379127059 stripped Transform: m_CorrespondingSourceObject: {fileID: 529881195364821077, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} diff --git a/Assets/Actors/Controllable/Car/Scripts/events.cs b/Assets/Actors/Controllable/Car/Scripts/events.cs new file mode 100644 index 0000000..04bb199 --- /dev/null +++ b/Assets/Actors/Controllable/Car/Scripts/events.cs @@ -0,0 +1,33 @@ +using UnityEngine; + +public class events : MonoBehaviour +{ + public delegate void Collision(); + public static event Collision collisions; + public static void PubCollision() + { + if (events.collisions != null) + events.collisions(); + } + + // Start is called once before the first execution of Update after the MonoBehaviour is created + void Start() + { + collisions += testCollisionSubscriber; + } + + // Update is called once per frame + void Update() + { + } + + void OnDestroy() + { + collisions -= testCollisionSubscriber; + } + + void testCollisionSubscriber() + { + Debug.Log("COLLISION IN SUB FEED"); + } +} diff --git a/Assets/Actors/Controllable/Car/Scripts/events.cs.meta b/Assets/Actors/Controllable/Car/Scripts/events.cs.meta new file mode 100644 index 0000000..f3ec381 --- /dev/null +++ b/Assets/Actors/Controllable/Car/Scripts/events.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: dff7018aae93db1aea5d93f82f4abdcd \ No newline at end of file