50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
|
|
using UdonSharp;
|
|
using UnityEngine;
|
|
using VRC.SDK3.UdonNetworkCalling;
|
|
using VRC.SDKBase;
|
|
using VRC.Udon;
|
|
|
|
public class NoPointsScreen : UdonSharpBehaviour
|
|
{
|
|
public NoPointsManager noPointsManager;
|
|
public TMPro.TMP_Text questionTitleText;
|
|
public GameObject answerInfoPanel;
|
|
public GameObject answerInfoTilePrefab;
|
|
|
|
[NetworkCallable]
|
|
public void ShowQuestionTitle(string title)
|
|
{
|
|
HideScreens();
|
|
questionTitleText.gameObject.SetActive(true);
|
|
questionTitleText.text = title;
|
|
}
|
|
|
|
[NetworkCallable]
|
|
public void ShowAnswerInfo(string[] answerInfo)
|
|
{
|
|
HideScreens();
|
|
answerInfoPanel.SetActive(true);
|
|
for (int i = answerInfoPanel.transform.childCount - 1; i >= 0; i--)
|
|
{
|
|
Destroy(answerInfoPanel.transform.GetChild(i).gameObject);
|
|
}
|
|
|
|
for (int i = 0; i < answerInfo.Length; i++)
|
|
{
|
|
GameObject infoTileObj = Instantiate(answerInfoTilePrefab, answerInfoPanel.transform);
|
|
NoPointsAnswerInfoTile infoTileText = infoTileObj.GetComponent<NoPointsAnswerInfoTile>();
|
|
if (infoTileText != null)
|
|
{
|
|
infoTileText.Initialize(answerInfo[i]);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void HideScreens()
|
|
{
|
|
questionTitleText.gameObject.SetActive(false);
|
|
answerInfoPanel.SetActive(false);
|
|
}
|
|
}
|