12345678910111213141516171819202122232425262728293031323334 |
- using UnityEngine;
- using UnityEngine.UIElements;
- /* 本段代码控制Start Game UI
- */
- public class StartGameUIController : MonoBehaviour
- {
- // Start is called once before the first execution of Update after the MonoBehaviour is created
- private Label infoLabel;
- private Button startButton;
- void Start()
- {
- var root = GetComponent<UIDocument>().rootVisualElement;
- infoLabel = root.Q<Label>("InfoLabel");
- startButton = root.Q<Button>("StartButton");
- infoLabel.text = UserProperty.name + "-" + EnviromentSetting.version;
- string textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "start_game", "button", "start", EnviromentSetting.languageCode });
- startButton.text = textValue;
- startButton.clicked += StartClick;
- }
- // Update is called once per frame
- // void Update()
- // {
-
- // }
- void StartClick(){
- MaskTransitions.TransitionManager.Instance.LoadLevel("Home");
- }
- }
|