NoPoints pretty much working
This commit is contained in:
49
Assets/Quiz/Scripts/NoPoints/NoPointsScreen.cs
Normal file
49
Assets/Quiz/Scripts/NoPoints/NoPointsScreen.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
|
||||
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);
|
||||
foreach (Transform child in answerInfoPanel.transform)
|
||||
{
|
||||
Destroy(child.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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user