-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from DerpyNewbie/feature/add-collision-invokers
Add collision related invokers
- Loading branch information
Showing
29 changed files
with
3,548 additions
and
1 deletion.
There are no files selected for viewing
467 changes: 467 additions & 0 deletions
467
Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.asset
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.asset.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Packages/dev.derpynewbie.common/Runtime/Invoker/OnCollisionEnterInvoker.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.