- Added new round 1 switchers, and fixed overlap issues with the existing ones. - Improved camera switch buttons on the host panel. - Potato Mode button on the camera host panel now toggles properly. - Potato Mode button renamed to the more appropriate Performance button. - Glass shatter window effect now works from both directions. - Round 1 window looks much prettier. - Added the ability to scroll through overflowing text on the host card. - Improved scrolling on the credits panel.
64 lines
910 B
C#
64 lines
910 B
C#
|
|
using UdonSharp;
|
|
using UnityEngine;
|
|
using VRC.Udon.Common.Interfaces;
|
|
|
|
|
|
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
|
|
public class GlassShatter : UdonSharpBehaviour
|
|
{
|
|
[SerializeField] AudioManager _AudioManager;
|
|
|
|
[UdonSynced, FieldChangeCallback(nameof(Shattered))] private bool _Shattered = false;
|
|
|
|
private bool _Prepared = false;
|
|
|
|
|
|
public void PrepareEnter()
|
|
{
|
|
if (!Shattered)
|
|
{
|
|
_Prepared = true;
|
|
}
|
|
}
|
|
public void PrepareExit()
|
|
{
|
|
_Prepared = false;
|
|
}
|
|
|
|
public void ShatterEnter()
|
|
{
|
|
if (_Prepared && !Shattered)
|
|
{
|
|
Shattered = true;
|
|
_Shatter_Synced();
|
|
RequestSerialization();
|
|
}
|
|
}
|
|
|
|
public void ShatterExit()
|
|
{
|
|
Shattered = false;
|
|
}
|
|
|
|
|
|
private void _Shatter_Synced()
|
|
{
|
|
if (Shattered)
|
|
{
|
|
_AudioManager.PlaySFX(SFXEventType.GlassShatter);
|
|
}
|
|
}
|
|
|
|
|
|
public bool Shattered
|
|
{
|
|
set
|
|
{
|
|
_Shattered = value;
|
|
_Shatter_Synced();
|
|
}
|
|
get => _Shattered;
|
|
}
|
|
}
|