private void Update() { if (Places == null) { return; } for (int i = 0; i < Places.Length; i++) { if (IsValidPlayer(Places[i])) { PlaceImages[i].gameObject.SetActive(true); var index = Places[i] - OyaPlayerIndex; if (index < 0) { index += TotalPlayers; } if (index > TotalPlayers) { index -= TotalPlayers; } PlaceImages[i].sprite = Images.Get(index); } else { PlaceImages[i].gameObject.SetActive(false); } } }
public void SetPoints(string playerName, int points, int place) { rect = GetComponent <RectTransform>(); PlayerNameText.text = playerName; PointController.SetNumber(points); PlaceNumber.sprite = NumberBundle.Get(place); PlaceCharacter.sprite = CharacterBundle.Get(place); }
private void SetAbsNumber(int number, SpriteBundle bundle) { var digits = ClientUtil.GetDigits(number); for (int i = 0; i < digits.Count; i++) { var obj = Instantiate(DigitPrefab, NumberParent); obj.name = $"Digit{i}"; var image = obj.GetComponent <Image>(); image.sprite = bundle.Get(digits[i]); } }
public void SetPlace(int place) { PlaceNumber.sprite = NumberBundle.Get(place); PlaceCharacter.sprite = CharacterBundle.Get(place); }