伴侣骑行
This commit is contained in:
1 parent
34cde86a28
commit
7744eec847
42 files changed
+18737
-13497
No files matched your search
@@ -0,0 +1,65 @@
|
||||
using Assets.Cyp.Common;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
public class SelectPlayerItemScript:MonoBehaviour
|
||||
{
|
||||
private string Id ;
|
||||
private RawImage Head;
|
||||
private Text Name;
|
||||
private Text Timer;
|
||||
private Button selectbutton;
|
||||
public bool isSelected;
|
||||
private void Awake()
|
||||
{
|
||||
Head = transform.Find("Head").GetComponent<RawImage>();
|
||||
Name = transform.Find("Name").GetComponent<Text>();
|
||||
Timer = transform.Find("Timer").GetComponent<Text>();
|
||||
selectbutton = transform.GetComponent<Button>();
|
||||
}
|
||||
private void Start()
|
||||
{
|
||||
|
||||
}
|
||||
public string GetRankingId()
|
||||
{
|
||||
return Id;
|
||||
}
|
||||
public string GetName()
|
||||
{
|
||||
return Name.text;
|
||||
}
|
||||
public Texture GetImageTexture()
|
||||
{
|
||||
return Head.texture;
|
||||
}
|
||||
public Button GetButton()
|
||||
{
|
||||
return selectbutton;
|
||||
}
|
||||
public void SetRankingId(string id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
public void SetName(string name)
|
||||
{
|
||||
Name.text = name;
|
||||
}
|
||||
public void SetTimer(string timer)
|
||||
{
|
||||
Timer.text = timer;
|
||||
}
|
||||
public void SetHeadImage(string url)
|
||||
{
|
||||
Utils.DisplayImage(StartCoroutine, Head, url);
|
||||
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