做土地租赁买卖的网站有哪些,温州15000 做网站的工作,seo就业哪家好,数据分析案例网站//1.实现让玩家的金币分数显示在UI文本中 2.让血量和滑动条关联起来
这一节课主要学会获取组件并改变属性#xff0c;举一反三#xff01; using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;//1.实现让玩… //1.实现让玩家的金币分数显示在UI文本中 2.让血量和滑动条关联起来
这一节课主要学会获取组件并改变属性举一反三 using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;//1.实现让玩家的金币分数显示在UI文本中 2.让血量和滑动条关联起来public class UImanager : MonoBehaviour
{public GameObject oneTextUI;TextMeshPro oneScoreText;//3D场景中TMP文本3D游戏物体文本TextMeshProUGUI oneScoreTextUI;//UI中的TMP文本游戏物体文本public GameObject oneBloodSlider;Slider oneSlider;public GameObject OneInputObj;//用来存储输入框TextMeshProUGUI OneInputtext;public TextMeshProUGUI PlayerName;//玩家昵称void Awake(){oneScoreTextUI oneTextUI.GetComponentTextMeshProUGUI();//从我自己身上拿到 一个TextMeshProUGUI组件oneSlider oneBloodSlider.GetComponentSlider();OneInputtext OneInputObj.GetComponentTextMeshProUGUI();}private void Update(){DisScoreUI();}void DisScoreUI()//自定义一个函数{oneScoreTextUI.text ScoreManager.CurrentScore.ToString();//把分数变量赋值给我的文本内容 oneSlider.value ScoreManager.CurrentBlood; //把血量变量赋值给滑动条中的Valuestring PlayName OneInputtext.text;PlayerName.text PlayName;}
}