伴侣骑行
This commit is contained in:
1 parent
34cde86a28
commit
7744eec847
42 files changed
+18737
-13497
No files matched your search
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
public class SeletedPlayerScript :MonoBehaviour
|
||||
{
|
||||
private RawImage Head;
|
||||
private Button Close;
|
||||
private Text Name;
|
||||
private string RankingId;
|
||||
public bool isUsed = false;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Head = transform.GetComponent<RawImage>();
|
||||
Name = transform.Find("Name").GetComponent<Text>();
|
||||
Close = transform.Find("CloseButton").GetComponent<Button>();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
||||
}
|
||||
public Button GetButton()
|
||||
{
|
||||
return Close;
|
||||
}
|
||||
public string GetRankingId()
|
||||
{
|
||||
return RankingId;
|
||||
}
|
||||
public void SetName(string name)
|
||||
{
|
||||
Name.text = name;
|
||||
}
|
||||
public void SetRankingId(string id)
|
||||
{
|
||||
RankingId = id;
|
||||
}
|
||||
public void Reset()
|
||||
{
|
||||
Close.gameObject.SetActive(false);
|
||||
isUsed = false;
|
||||
Name.text = "New Shadow";
|
||||
var defaultexture = Resources.Load<Sprite>("Images/New Account").texture;
|
||||
Head.texture = defaultexture;
|
||||
RankingId = string.Empty;
|
||||
}
|
||||
public void SetHead(Texture texture, bool select)
|
||||
{
|
||||
Close.gameObject.SetActive(select);
|
||||
isUsed = select;
|
||||
Head.texture = texture;
|
||||
var rect = ((RectTransform)Head.transform).rect;
|
||||
Material material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
|
||||
material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height, 0));
|
||||
Head.material = material;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user