Add initial UI Toolkit setup and schemas

This commit is contained in:
2025-10-04 18:32:09 +02:00
parent 0118860a6f
commit e5321b1671
31 changed files with 6649 additions and 251 deletions

32
Assets/SimpleRuntimeUI.cs Normal file
View File

@@ -0,0 +1,32 @@
using System;
using UnityEngine;
using UnityEngine.Serialization;
using UnityEngine.UIElements;
public class SimpleRuntimeUI : MonoBehaviour
{
private Label _forceLabel;
private Label _timeScaleLabel;
[SerializeField]
private TestScript testScript;
private void OnEnable()
{
var uiDocument = GetComponent<UIDocument>();
_forceLabel = uiDocument.rootVisualElement.Q<Label>("forceLabel");
_timeScaleLabel = uiDocument.rootVisualElement.Q<Label>("timeScaleLabel");
}
private void Start()
{
_forceLabel.text = "Hello World";
}
private void Update()
{
_forceLabel.text = testScript.GetTorqueForce().ToString();
_timeScaleLabel.text = Time.timeScale.ToString();
}
}