WXGame/b1/Assets/脚本/玩家信息/PlayerUser_Mon.cs

73 lines
1.9 KiB
C#
Raw Normal View History

2024-10-23 09:14:01 +08:00
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
/// </summary>
public class PlayerUser_Mon : MonoBehaviour
{
/// <summary>
/// <20><><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7>
/// </summary>
private Image usericon;
/// <summary>
/// <20>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
private TextMeshProUGUI username;
/// <summary>
/// <20><><EFBFBD>ҵȼ<D2B5>
/// </summary>
private TextMeshProUGUI grade;
/// <summary>
/// <20><><EFBFBD><EFBFBD>
/// </summary>
private TextMeshProUGUI strength;
/// <summary>
/// <20><><EFBFBD><EFBFBD>
/// </summary>
private TextMeshProUGUI money;
/// <summary>
/// <20><>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>
/// </summary>
private void LoadGame()
{
this.usericon=this.transform.Find("<22>û<EFBFBD>ͷ<EFBFBD><CDB7>").GetComponent<Image>();
this.username = this.transform.Find("<22>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>").GetComponent<TextMeshProUGUI>();
this.grade=this.transform.Find("<22>ȼ<EFBFBD>value").GetComponent<TextMeshProUGUI>();
this.strength=this.transform.Find("<22><><EFBFBD><EFBFBD>BG").Find("<22><><EFBFBD><EFBFBD>").GetComponent <TextMeshProUGUI>();
this.money = this.transform.Find("<22><><EFBFBD><EFBFBD>BG").Find("<22><><EFBFBD><EFBFBD>").GetComponent<TextMeshProUGUI>();
}
/// <summary>
/// UI<55><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD>
/// </summary>
/// <param name="usericon_"><3E>û<EFBFBD>ͼ<EFBFBD><CDBC></param>
/// <param name="username_"><3E>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD></param>
/// <param name="grade_"><3E>û<EFBFBD><C3BB>ȼ<EFBFBD></param>
/// <param name="strength_"><3E>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD></param>
/// <param name="money_"><3E>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD></param>
public void LoadGameUI(Sprite usericon_,string username_,int grade_,int strength_,int money_)
{
this.usericon.sprite = usericon_;
this.username.text= username_;
this.grade.text=grade_.ToString();
this.strength.text= strength_.ToString();
this.money.text=money_.ToString();
}
private void Awake()
{
this.LoadGame();
}
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}