- Host card spawner now switches ownership on interact to prevent sync issues. - Host card spawner now has an inset square collider to get in the way less. - Adjusted collision box of location board to not block the host card spawner. - Phone box cover now closes automatically when round 2 ends.
37 lines
751 B
C#
37 lines
751 B
C#
|
|
using UdonSharp;
|
|
using UnityEngine;
|
|
using VRC.SDKBase;
|
|
|
|
|
|
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
|
|
public class HostCardSpawner : UdonSharpBehaviour
|
|
{
|
|
[SerializeField] private GameObject _HostCard;
|
|
[SerializeField] private Collider _InteractiveCollider;
|
|
|
|
|
|
public override void Interact()
|
|
{
|
|
Networking.SetOwner(Networking.LocalPlayer, gameObject);
|
|
Networking.SetOwner(Networking.LocalPlayer, _HostCard);
|
|
|
|
_HostCard.transform.parent = transform;
|
|
_HostCard.transform.localPosition = Vector3.zero;
|
|
_HostCard.transform.localRotation = Quaternion.identity;
|
|
|
|
base.Interact();
|
|
}
|
|
|
|
|
|
public void HostEnabled()
|
|
{
|
|
_InteractiveCollider.enabled = true;
|
|
}
|
|
|
|
public void HostDisabled()
|
|
{
|
|
_InteractiveCollider.enabled = false;
|
|
}
|
|
}
|