Universally challenged added

This commit is contained in:
2025-12-05 21:57:51 +00:00
parent 7a0fbeed7e
commit d2c18d2264
340 changed files with 109977 additions and 1616 deletions

View File

@@ -0,0 +1,58 @@

using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
public class UCController : UdonSharpBehaviour
{
public UCQuestion[] questions;
public GameObject questionList;
public GameObject questionListItemPrefab;
public TMPro.TextMeshProUGUI mainQuestionText;
public TMPro.TextMeshProUGUI bonusQuestionInfoText;
public TMPro.TextMeshProUGUI bonusQuestion1Text;
public TMPro.TextMeshProUGUI bonusQuestion2Text;
public TMPro.TextMeshProUGUI bonusQuestion3Text;
public void Start()
{
for (int i = 0; i < questions.Length; i++)
{
UCQuestion question = questions[i];
GameObject listItemObj = Instantiate(questionListItemPrefab, questionList.transform);
UCQuestionListItem listItem = listItemObj.GetComponent<UCQuestionListItem>();
if (listItem != null)
{
listItem.Initialize(question);
listItem.controller = this;
}
}
}
public void ChangeQuestionPanel(UCQuestion question)
{
if (mainQuestionText != null)
{
mainQuestionText.text = question.mainQuestion;
}
if (bonusQuestionInfoText != null)
{
bonusQuestionInfoText.text = question.bonusQuestionInfo;
}
if (bonusQuestion1Text != null)
{
bonusQuestion1Text.text = question.bonusQuestion1;
}
if (bonusQuestion2Text != null)
{
bonusQuestion2Text.text = question.bonusQuestion2;
}
if (bonusQuestion3Text != null)
{
bonusQuestion3Text.text = question.bonusQuestion3;
}
}
}