33 lines
891 B
C#
33 lines
891 B
C#
|
|
using UdonSharp;
|
|
using UnityEngine;
|
|
using VRC.SDKBase;
|
|
using VRC.Udon.Common.Enums;
|
|
|
|
|
|
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
|
|
public class LightningStrikeStation : UdonSharpBehaviour
|
|
{
|
|
[SerializeField] private CaseManager _CaseManager;
|
|
[SerializeField] private VRCStation _Station;
|
|
[SerializeField] private VRCStation _Reset;
|
|
[Space]
|
|
[SerializeField, Range(0.0f, 10.0f)] private float _DelayBeforeEjecting = 2.0f;
|
|
|
|
|
|
public void EnterStation()
|
|
{
|
|
_Station.UseStation(Networking.LocalPlayer);
|
|
SendCustomEventDelayedSeconds(nameof(RemoveFromStation), _DelayBeforeEjecting, EventTiming.LateUpdate);
|
|
}
|
|
public void RemoveFromStation()
|
|
{
|
|
_Reset.UseStation(Networking.LocalPlayer);
|
|
SendCustomEventDelayedSeconds(nameof(RemoveFromResetStation), 0.1f, EventTiming.LateUpdate);
|
|
}
|
|
public void RemoveFromResetStation()
|
|
{
|
|
_Reset.ExitStation(Networking.LocalPlayer);
|
|
}
|
|
}
|