30 lines
709 B
C#
30 lines
709 B
C#
|
|
using UdonSharp;
|
|
using UnityEngine;
|
|
using VRC.SDK3.UdonNetworkCalling;
|
|
using VRC.Udon.Common.Interfaces;
|
|
|
|
|
|
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
|
|
public class ChoiceCard : UdonSharpBehaviour
|
|
{
|
|
[UdonSynced] public int ChoiceNumber = 0;
|
|
[SerializeField] private ChoiceCardGroup CardGroup = null;
|
|
|
|
public override void OnPickup()
|
|
{
|
|
NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)CardGroup, NetworkEventTarget.All, "ChoiceCardInteract", ChoiceNumber);
|
|
}
|
|
|
|
public void SetParent(ChoiceCardGroup ParentCardGroup)
|
|
{
|
|
CardGroup = ParentCardGroup;
|
|
}
|
|
|
|
public void ResetPosition()
|
|
{
|
|
transform.localPosition = Vector3.zero;
|
|
transform.localRotation = Quaternion.identity;
|
|
}
|
|
}
|