Glass shatter effect now works only when the hosts jump through the window.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user