From a1c18b7d90822eda2726c363c83ca10abfc288a1 Mon Sep 17 00:00:00 2001 From: DerpyNewbie Date: Sun, 3 Nov 2024 17:02:56 +0900 Subject: [PATCH] Add collision related invokers --- .../Invoker/OnCollisionEnterInvoker.asset | 467 ++++++++++++++++++ .../OnCollisionEnterInvoker.asset.meta | 8 + .../Invoker/OnCollisionEnterInvoker.cs | 21 + .../Invoker/OnCollisionEnterInvoker.cs.meta | 11 + .../Invoker/OnCollisionExitInvoker.asset | 467 ++++++++++++++++++ .../Invoker/OnCollisionExitInvoker.asset.meta | 8 + .../Runtime/Invoker/OnCollisionExitInvoker.cs | 21 + .../Invoker/OnCollisionExitInvoker.cs.meta | 11 + .../OnPlayerCollisionEnterInvoker.asset | 467 ++++++++++++++++++ .../OnPlayerCollisionEnterInvoker.asset.meta | 8 + .../Invoker/OnPlayerCollisionEnterInvoker.cs | 19 + .../OnPlayerCollisionEnterInvoker.cs.meta | 11 + .../OnPlayerCollisionExitInvoker.asset | 467 ++++++++++++++++++ .../OnPlayerCollisionExitInvoker.asset.meta | 8 + .../Invoker/OnPlayerCollisionExitInvoker.cs | 19 + .../OnPlayerCollisionExitInvoker.cs.meta | 11 + .../Invoker/OnPlayerTriggerEnterInvoker.cs | 2 +- .../Invoker/OnPlayerTriggerExitInvoker.asset | 467 ++++++++++++++++++ .../OnPlayerTriggerExitInvoker.asset.meta | 8 + .../Invoker/OnPlayerTriggerExitInvoker.cs | 19 + .../OnPlayerTriggerExitInvoker.cs.meta | 11 + .../Invoker/OnTriggerEnterInvoker.asset | 467 ++++++++++++++++++ .../Invoker/OnTriggerEnterInvoker.asset.meta | 8 + .../Runtime/Invoker/OnTriggerEnterInvoker.cs | 23 + .../Invoker/OnTriggerEnterInvoker.cs.meta | 11 + .../Invoker/OnTriggerExitInvoker.asset | 467 ++++++++++++++++++ .../Invoker/OnTriggerExitInvoker.asset.meta | 8 + .../Runtime/Invoker/OnTriggerExitInvoker.cs | 23 + .../Invoker/OnTriggerExitInvoker.cs.meta | 11 + 29 files changed, 3548 insertions(+), 1 deletion(-) create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.asset create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.asset.meta create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.cs create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.cs.meta create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.asset create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.asset.meta create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.cs create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.cs.meta create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.asset create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.asset.meta create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.cs create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.cs.meta create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.asset create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.asset.meta create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.cs create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.cs.meta create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.asset create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.asset.meta create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.cs create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.cs.meta create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.asset create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.asset.meta create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.cs create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.cs.meta create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.asset create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.asset.meta create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.cs create mode 100644 Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.cs.meta diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.asset b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.asset new file mode 100644 index 0000000..b248f9d --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.asset @@ -0,0 +1,467 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: OnCollisionEnterInvoker + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 3e5359af985c1ef4fa64d327c23d35bb, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: eb3025b494bea3948889246fce6902d9, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 2 + hasInteractEvent: 0 + scriptID: 2699574100953367404 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 7 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: listeners + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: listeners + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UdonSharp.UdonSharpBehaviour[], UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 4|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 6|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: eventName + - Name: $v + Entry: 7 + Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: eventName + - Name: k__BackingField + Entry: 7 + Data: 8|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 8 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 10|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: delay + - Name: $v + Entry: 7 + Data: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: delay + - Name: k__BackingField + Entry: 7 + Data: 12|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 12 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 14|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: timing + - Name: $v + Entry: 7 + Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: timing + - Name: k__BackingField + Entry: 7 + Data: 16|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.Common.Enums.EventTiming, VRC.Udon.Common + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 16 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 18|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isGlobal + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isGlobal + - Name: k__BackingField + Entry: 7 + Data: 20|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 22|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isMasterOnly + - Name: $v + Entry: 7 + Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isMasterOnly + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 25|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isTriggeringOnLocalOnly + - Name: $v + Entry: 7 + Data: 26|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isTriggeringOnLocalOnly + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 28|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.asset.meta b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.asset.meta new file mode 100644 index 0000000..59d94c0 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fb5ac16e8c06b944ba2106eb9a17443a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.cs b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.cs new file mode 100644 index 0000000..df8d3f3 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.cs @@ -0,0 +1,21 @@ +using UnityEngine; +using VRC.SDKBase; + +namespace DerpyNewbie.Common.Invoker +{ + [AddComponentMenu("Newbie Commons/Invoker/Collision/On Collision Enter")] + public class OnCollisionEnterInvoker : CommonInvokerBase + { + [SerializeField] + private bool isTriggeringOnLocalOnly = true; + + private void OnCollisionEnter(Collision collision) + { + if (collision.gameObject == null) return; + + if (isTriggeringOnLocalOnly && !Networking.IsOwner(collision.gameObject)) + return; + Invoke(); + } + } +} \ No newline at end of file diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.cs.meta b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.cs.meta new file mode 100644 index 0000000..096dc1f --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eb3025b494bea3948889246fce6902d9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.asset b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.asset new file mode 100644 index 0000000..7e150a8 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.asset @@ -0,0 +1,467 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: OnCollisionExitInvoker + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: acebe7e277cb80a48b98ede59676e445, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 4b2279533ba85d947839e4bae4be5d7a, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 2 + hasInteractEvent: 0 + scriptID: 576997586127084992 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 7 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: listeners + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: listeners + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UdonSharp.UdonSharpBehaviour[], UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 4|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 6|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: eventName + - Name: $v + Entry: 7 + Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: eventName + - Name: k__BackingField + Entry: 7 + Data: 8|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 8 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 10|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: delay + - Name: $v + Entry: 7 + Data: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: delay + - Name: k__BackingField + Entry: 7 + Data: 12|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 12 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 14|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: timing + - Name: $v + Entry: 7 + Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: timing + - Name: k__BackingField + Entry: 7 + Data: 16|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.Common.Enums.EventTiming, VRC.Udon.Common + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 16 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 18|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isGlobal + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isGlobal + - Name: k__BackingField + Entry: 7 + Data: 20|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 22|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isMasterOnly + - Name: $v + Entry: 7 + Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isMasterOnly + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 25|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isTriggeringOnLocalOnly + - Name: $v + Entry: 7 + Data: 26|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isTriggeringOnLocalOnly + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 28|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.asset.meta b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.asset.meta new file mode 100644 index 0000000..95f8bf1 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d06bef49919a6854a8b65566ecb1dea1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.cs b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.cs new file mode 100644 index 0000000..8aadfbd --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.cs @@ -0,0 +1,21 @@ +using UnityEngine; +using VRC.SDKBase; + +namespace DerpyNewbie.Common.Invoker +{ + [AddComponentMenu("Newbie Commons/Invoker/Collision/On Collision Exit")] + public class OnCollisionExitInvoker : CommonInvokerBase + { + [SerializeField] + private bool isTriggeringOnLocalOnly = true; + + private void OnCollisionExit(Collision collision) + { + if (collision.gameObject == null) return; + + if (isTriggeringOnLocalOnly && !Networking.IsOwner(collision.gameObject)) + return; + Invoke(); + } + } +} \ No newline at end of file diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.cs.meta b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.cs.meta new file mode 100644 index 0000000..2a94218 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionExitInvoker.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b2279533ba85d947839e4bae4be5d7a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.asset b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.asset new file mode 100644 index 0000000..ff53ca4 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.asset @@ -0,0 +1,467 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: OnPlayerCollisionEnterInvoker + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 4c6e555b8f4d6b0499fd6b1e88c9f668, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: f829aedb8dd5fd541a7886cd8ef2c563, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 2 + hasInteractEvent: 0 + scriptID: 8499898033186174102 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 7 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: listeners + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: listeners + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UdonSharp.UdonSharpBehaviour[], UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 4|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 6|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: eventName + - Name: $v + Entry: 7 + Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: eventName + - Name: k__BackingField + Entry: 7 + Data: 8|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 8 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 10|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: delay + - Name: $v + Entry: 7 + Data: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: delay + - Name: k__BackingField + Entry: 7 + Data: 12|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 12 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 14|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: timing + - Name: $v + Entry: 7 + Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: timing + - Name: k__BackingField + Entry: 7 + Data: 16|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.Common.Enums.EventTiming, VRC.Udon.Common + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 16 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 18|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isGlobal + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isGlobal + - Name: k__BackingField + Entry: 7 + Data: 20|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 22|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isMasterOnly + - Name: $v + Entry: 7 + Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isMasterOnly + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 25|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isTriggeringOnLocalOnly + - Name: $v + Entry: 7 + Data: 26|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isTriggeringOnLocalOnly + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 28|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.asset.meta b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.asset.meta new file mode 100644 index 0000000..046b6c0 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 450114c81b5f12d44b56951178691abe +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.cs b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.cs new file mode 100644 index 0000000..811028c --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.cs @@ -0,0 +1,19 @@ +using UnityEngine; +using VRC.SDKBase; + +namespace DerpyNewbie.Common.Invoker +{ + [AddComponentMenu("Newbie Commons/Invoker/Collision/On Player Collision Enter Event")] + public class OnPlayerCollisionEnterInvoker : CommonInvokerBase + { + [SerializeField] + private bool isTriggeringOnLocalOnly = true; + + public override void OnPlayerCollisionEnter(VRCPlayerApi player) + { + if (isTriggeringOnLocalOnly && player.isLocal == false) + return; + Invoke(); + } + } +} \ No newline at end of file diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.cs.meta b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.cs.meta new file mode 100644 index 0000000..dfb5818 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionEnterInvoker.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f829aedb8dd5fd541a7886cd8ef2c563 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.asset b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.asset new file mode 100644 index 0000000..9c2d790 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.asset @@ -0,0 +1,467 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: OnPlayerCollisionExitInvoker + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 1d89667a49d31b6439492834b8a9ce59, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 46bfc276376313844ba06ae819e0fe73, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 2 + hasInteractEvent: 0 + scriptID: 3952074142902808924 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 7 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: listeners + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: listeners + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UdonSharp.UdonSharpBehaviour[], UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 4|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 6|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: eventName + - Name: $v + Entry: 7 + Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: eventName + - Name: k__BackingField + Entry: 7 + Data: 8|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 8 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 10|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: delay + - Name: $v + Entry: 7 + Data: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: delay + - Name: k__BackingField + Entry: 7 + Data: 12|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 12 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 14|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: timing + - Name: $v + Entry: 7 + Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: timing + - Name: k__BackingField + Entry: 7 + Data: 16|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.Common.Enums.EventTiming, VRC.Udon.Common + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 16 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 18|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isGlobal + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isGlobal + - Name: k__BackingField + Entry: 7 + Data: 20|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 22|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isMasterOnly + - Name: $v + Entry: 7 + Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isMasterOnly + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 25|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isTriggeringOnLocalOnly + - Name: $v + Entry: 7 + Data: 26|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isTriggeringOnLocalOnly + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 28|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.asset.meta b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.asset.meta new file mode 100644 index 0000000..4588c4b --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 59a29b7a19632694ca771952b19d709a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.cs b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.cs new file mode 100644 index 0000000..42d37e4 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.cs @@ -0,0 +1,19 @@ +using UnityEngine; +using VRC.SDKBase; + +namespace DerpyNewbie.Common.Invoker +{ + [AddComponentMenu("Newbie Commons/Invoker/Collision/On Player Collision Exit Event")] + public class OnPlayerCollisionExitInvoker : CommonInvokerBase + { + [SerializeField] + private bool isTriggeringOnLocalOnly = true; + + public override void OnPlayerCollisionExit(VRCPlayerApi player) + { + if (isTriggeringOnLocalOnly && player.isLocal == false) + return; + Invoke(); + } + } +} \ No newline at end of file diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.cs.meta b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.cs.meta new file mode 100644 index 0000000..268b234 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerCollisionExitInvoker.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46bfc276376313844ba06ae819e0fe73 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerEnterInvoker.cs b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerEnterInvoker.cs index b0b361a..e519455 100644 --- a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerEnterInvoker.cs +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerEnterInvoker.cs @@ -3,7 +3,7 @@ namespace DerpyNewbie.Common.Invoker { - [AddComponentMenu("Newbie Commons/Invoker/On Player Trigger Enter Event")] + [AddComponentMenu("Newbie Commons/Invoker/Collision/On Player Trigger Enter Event")] public class OnPlayerTriggerEnterInvoker : CommonInvokerBase { [SerializeField] diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.asset b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.asset new file mode 100644 index 0000000..53848f6 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.asset @@ -0,0 +1,467 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: OnPlayerTriggerExitInvoker + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: b5cbeb120e245d445b03af748a05dcab, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 655d68236a2c8c147ab1d8c69ddd5de3, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 2 + hasInteractEvent: 0 + scriptID: 465101679554123271 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 7 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: listeners + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: listeners + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UdonSharp.UdonSharpBehaviour[], UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 4|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 6|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: eventName + - Name: $v + Entry: 7 + Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: eventName + - Name: k__BackingField + Entry: 7 + Data: 8|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 8 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 10|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: delay + - Name: $v + Entry: 7 + Data: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: delay + - Name: k__BackingField + Entry: 7 + Data: 12|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 12 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 14|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: timing + - Name: $v + Entry: 7 + Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: timing + - Name: k__BackingField + Entry: 7 + Data: 16|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.Common.Enums.EventTiming, VRC.Udon.Common + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 16 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 18|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isGlobal + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isGlobal + - Name: k__BackingField + Entry: 7 + Data: 20|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 22|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isMasterOnly + - Name: $v + Entry: 7 + Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isMasterOnly + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 25|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isTriggeringOnLocalOnly + - Name: $v + Entry: 7 + Data: 26|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isTriggeringOnLocalOnly + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 28|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.asset.meta b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.asset.meta new file mode 100644 index 0000000..2ddf7e0 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 07c91393256946e40b23c5638107a106 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.cs b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.cs new file mode 100644 index 0000000..7b66b1b --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.cs @@ -0,0 +1,19 @@ +using UnityEngine; +using VRC.SDKBase; + +namespace DerpyNewbie.Common.Invoker +{ + [AddComponentMenu("Newbie Commons/Invoker/Collision/On Player Trigger Exit Event")] + public class OnPlayerTriggerExitInvoker : CommonInvokerBase + { + [SerializeField] + private bool isTriggeringOnLocalOnly = true; + + public override void OnPlayerTriggerExit(VRCPlayerApi player) + { + if (isTriggeringOnLocalOnly && player.isLocal == false) + return; + Invoke(); + } + } +} \ No newline at end of file diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.cs.meta b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.cs.meta new file mode 100644 index 0000000..1847b9d --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnPlayerTriggerExitInvoker.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 655d68236a2c8c147ab1d8c69ddd5de3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.asset b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.asset new file mode 100644 index 0000000..04fb581 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.asset @@ -0,0 +1,467 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: OnTriggerEnterInvoker + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 9b088e9295d404e4b9fc963c662783b7, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: a7459c60f6f9eb34f8740ccfa0d13ecf, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 2 + hasInteractEvent: 0 + scriptID: -8239958412707423816 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 7 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: listeners + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: listeners + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UdonSharp.UdonSharpBehaviour[], UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 4|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 6|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: eventName + - Name: $v + Entry: 7 + Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: eventName + - Name: k__BackingField + Entry: 7 + Data: 8|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 8 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 10|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: delay + - Name: $v + Entry: 7 + Data: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: delay + - Name: k__BackingField + Entry: 7 + Data: 12|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 12 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 14|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: timing + - Name: $v + Entry: 7 + Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: timing + - Name: k__BackingField + Entry: 7 + Data: 16|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.Common.Enums.EventTiming, VRC.Udon.Common + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 16 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 18|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isGlobal + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isGlobal + - Name: k__BackingField + Entry: 7 + Data: 20|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 22|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isMasterOnly + - Name: $v + Entry: 7 + Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isMasterOnly + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 25|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isTriggeringOnLocalOnly + - Name: $v + Entry: 7 + Data: 26|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isTriggeringOnLocalOnly + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 28|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.asset.meta b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.asset.meta new file mode 100644 index 0000000..9d5cbb2 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3106c21250c4e0b4ca673399de39dae5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.cs b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.cs new file mode 100644 index 0000000..c5fa039 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.cs @@ -0,0 +1,23 @@ +using UnityEngine; +using VRC.SDKBase; + +namespace DerpyNewbie.Common.Invoker +{ + [AddComponentMenu("Newbie Commons/Invoker/Collision/On Trigger Enter")] + public class OnTriggerEnterInvoker : CommonInvokerBase + { + [SerializeField] + private bool isTriggeringOnLocalOnly = true; + + private void OnTriggerEnter(Collider other) + { + // null is possible for VRCPlayerApi colliding with trigger + // ReSharper disable once ConditionIsAlwaysTrueOrFalse + if (other.gameObject == null) return; + + if (isTriggeringOnLocalOnly && !Networking.IsOwner(other.gameObject)) + return; + Invoke(); + } + } +} \ No newline at end of file diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.cs.meta b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.cs.meta new file mode 100644 index 0000000..d965d84 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerEnterInvoker.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a7459c60f6f9eb34f8740ccfa0d13ecf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.asset b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.asset new file mode 100644 index 0000000..c75cb40 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.asset @@ -0,0 +1,467 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: OnTriggerExitInvoker + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 15ede08161dcdd54d956a7e0cedd2e4c, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: a246c963f66192945809664c77ce905b, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 2 + hasInteractEvent: 0 + scriptID: -4536619788875420010 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 7 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: listeners + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: listeners + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UdonSharp.UdonSharpBehaviour[], UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 4|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 6|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: eventName + - Name: $v + Entry: 7 + Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: eventName + - Name: k__BackingField + Entry: 7 + Data: 8|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 8 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 10|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: delay + - Name: $v + Entry: 7 + Data: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: delay + - Name: k__BackingField + Entry: 7 + Data: 12|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 12 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 14|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: timing + - Name: $v + Entry: 7 + Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: timing + - Name: k__BackingField + Entry: 7 + Data: 16|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.Common.Enums.EventTiming, VRC.Udon.Common + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 16 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 18|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isGlobal + - Name: $v + Entry: 7 + Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isGlobal + - Name: k__BackingField + Entry: 7 + Data: 20|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 22|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isMasterOnly + - Name: $v + Entry: 7 + Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isMasterOnly + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 25|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: isTriggeringOnLocalOnly + - Name: $v + Entry: 7 + Data: 26|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: isTriggeringOnLocalOnly + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 9 + Data: 20 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 28|UnityEngine.SerializeField, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.asset.meta b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.asset.meta new file mode 100644 index 0000000..573b615 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b38dca9996ebd3b419ad09d3560a085a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.cs b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.cs new file mode 100644 index 0000000..4a43fb0 --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.cs @@ -0,0 +1,23 @@ +using UnityEngine; +using VRC.SDKBase; + +namespace DerpyNewbie.Common.Invoker +{ + [AddComponentMenu("Newbie Commons/Invoker/Collision/On Trigger Exit")] + public class OnTriggerExitInvoker : CommonInvokerBase + { + [SerializeField] + private bool isTriggeringOnLocalOnly = true; + + private void OnTriggerExit(Collider other) + { + // null is possible for VRCPlayerApi colliding with trigger + // ReSharper disable once ConditionIsAlwaysTrueOrFalse + if (other.gameObject == null) return; + + if (isTriggeringOnLocalOnly && !Networking.IsOwner(other.gameObject)) + return; + Invoke(); + } + } +} \ No newline at end of file diff --git a/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.cs.meta b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.cs.meta new file mode 100644 index 0000000..bb6fadb --- /dev/null +++ b/Packages/dev.derpynewbie.common/Runtime/Invoker/OnTriggerExitInvoker.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a246c963f66192945809664c77ce905b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: