12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using UnityEngine;
- using System.Collections;
- public class ResultItem : MonoBehaviour
- {
- public int index;
- public GameObject nickObj;
- public GameObject killObj;
- public GameObject deathObj;
- public GameObject[] bgs;
- private PlayerStatsData data;
- public void setData(PlayerStatsData data)
- {
- if(data == null)
- {
- this.transform.position = new Vector3(float.MaxValue, 0, 0);
- return;
- }
- Color color = TeamUtil.GetTeamColor(data.team.GetHashCode());
- nickObj.GetComponent<TextMesh>().color = killObj.GetComponent<TextMesh>().color = deathObj.GetComponent<TextMesh>().color = color;
- nickObj.GetComponent<TextMesh>().text = data.nick;
- killObj.GetComponent<TextMesh>().text = data.kill.ToString();
- deathObj.GetComponent<TextMesh>().text = data.death.ToString();
- for(int i=0; i<bgs.Length; i++)
- {
- if(index%2==0)
- {
- color.a = 0.2f;
- bgs[i].GetComponent<Renderer>().material.color = color;
- }
- else
- {
- color.a = 0.1f;
- bgs[i].GetComponent<Renderer>().material.color = color;
- }
- }
- }
- }
|