Glass shatter effect now works only when the hosts jump through the window.

This commit is contained in:
2026-05-03 16:55:32 -04:00
parent 32a34b4833
commit 7d275ae426
15 changed files with 782 additions and 439 deletions
+3 -22
View File
@@ -1,7 +1,7 @@
using UdonSharp;
using UnityEngine;
using VRC.Udon.Common.Interfaces;
using VRC.SDKBase;
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
@@ -15,29 +15,9 @@ public class GlassShatter : UdonSharpBehaviour
private bool _Prepared = false;
public void HostEnabled()
{
foreach (Collider GlassCollider in _Colliders)
{
GlassCollider.gameObject.SetActive(true);
}
}
public void HostDisabled()
{
foreach (Collider GlassCollider in _Colliders)
{
GlassCollider.gameObject.SetActive(false);
}
}
public void PrepareEnter()
{
if (!Shattered)
{
_Prepared = true;
}
_Prepared = true;
}
public void PrepareExit()
{
@@ -48,6 +28,7 @@ public class GlassShatter : UdonSharpBehaviour
{
if (_Prepared && !Shattered)
{
Networking.SetOwner(Networking.LocalPlayer, gameObject);
Shattered = true;
_Shatter_Synced();
RequestSerialization();