2026-06-17 스타터킷,툰셰이더,오른손

This commit is contained in:
2026-06-17 10:51:49 +09:00
parent 48c3cfe9f1
commit 6ccae390f6
2067 changed files with 115278 additions and 697 deletions

View File

@@ -1,8 +1,7 @@
#if TEXT_MESH_PRO_PRESENT || (UGUI_2_0_PRESENT && UNITY_6000_0_OR_NEWER)
using TMPro;
#endif
using UnityEngine;
using UnityEngine.UI;
namespace UnityEngine.XR.Interaction.Toolkit.Samples.StarterAssets
namespace XR.Interaction.Toolkit.Samples
{
/// <summary>
/// Add this component to a GameObject and call the <see cref="IncrementText"/> method
@@ -10,35 +9,18 @@ namespace UnityEngine.XR.Interaction.Toolkit.Samples.StarterAssets
/// </summary>
public class IncrementUIText : MonoBehaviour
{
#if TEXT_MESH_PRO_PRESENT || (UGUI_2_0_PRESENT && UNITY_6000_0_OR_NEWER)
[SerializeField]
[Tooltip("The TextMeshProUGUI component this behavior uses to display the incremented value.")]
TextMeshProUGUI m_Text;
[Tooltip("The Text component this behavior uses to display the incremented value.")]
Text m_Text;
/// <summary>
/// The TextMeshProUGUI component this behavior uses to display the incremented value.
/// The Text component this behavior uses to display the incremented value.
/// </summary>
public TextMeshProUGUI text
public Text text
{
get => m_Text;
set => m_Text = value;
}
#else
// Fallback field to keep the component functional without TMP.
// Uses UnityEngine.Object so it can still hold a reference if TMP later becomes available.
[SerializeField]
[Tooltip("The TextMeshProUGUI component this behavior uses to display the incremented value.")]
Object m_Text;
/// <summary>
/// The TextMeshProUGUI component this behavior uses to display the incremented value.
/// </summary>
public Object text
{
get => m_Text;
set => m_Text = value;
}
#endif
int m_Count;
@@ -48,22 +30,17 @@ public Object text
protected void Awake()
{
if (m_Text == null)
Debug.LogWarning("Missing required TextMeshProUGUI component reference. Use the Inspector window to assign which TMP component to increment.", this);
Debug.LogWarning("Missing required Text component reference. Use the Inspector window to assign which Text component to increment.", this);
}
/// <summary>
/// Increment the string message of the TextMeshProUGUI component.
/// Increment the string message of the Text component.
/// </summary>
public void IncrementText()
{
m_Count += 1;
#if TEXT_MESH_PRO_PRESENT || (UGUI_2_0_PRESENT && UNITY_6000_0_OR_NEWER)
if (m_Text != null)
m_Text.text = m_Count.ToString();
#else
if (m_Text != null)
Debug.LogWarning("TextMeshPro is not installed; cannot update TMP text.", this);
#endif
}
}
}