poc firehydrant oncollide publishes to Car.events script subscribers wheeeeeeeeeeeee

This commit is contained in:
2026-03-22 11:54:09 -06:00
parent 322226c8c0
commit f46b17558e
5 changed files with 71 additions and 0 deletions

View File

@@ -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();
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f63a4aa77aafd2b12a2554da4978087c

View File

@@ -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}

View File

@@ -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");
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: dff7018aae93db1aea5d93f82f4abdcd