void OnSpawn(CharacterMatchData data) { if (data == null || _displays.Count <= 0) return; GameObject display = null; while (_displays.Count > 0 && display == null) { display = _displays[0]; _displays.RemoveAt(0); } if (display == null) return; if (playerIndicatorPrefab != null) { PlayerIndicator indicator = playerIndicatorPrefab.InstantiateNew(); indicator.Target = data.SpawnedInstance; } _displays.Remove(display); display.SetActive(true); // Update the display with the Character information foreach (ICharacterGUIComponent component in display.GetComponentsInChildren<ICharacterGUIComponent>()) component.SetCharacterData(data); display.name = "Player " + (data.PlayerNumber + 1) + " Display"; }
public void SetCharacterData(CharacterMatchData data) { if (_text == null) return; if (data == null || data.Data == null) _text.text = ""; else _text.text = ProcessName(data.Data.FirstName); }
public void SetCharacterData(CharacterMatchData data) { if (data == null) return; PlayerNumber = data.PlayerNumber; if (_graphic == null) _graphic = GetComponent<Graphic>(); if (_graphic) _graphic.color = AdjustedColor; }
public void SetCharacterData(CharacterMatchData data) { if (Image == null) return; if (data == null || data.Data == null) { Image.enabled = false; } else { Image.enabled = true; Image.sprite = data.Data.LoadPortrait(data.Pallete); } }
public void SetCharacterData(CharacterMatchData data) { if (data == null || data.SpawnedInstance == null) { Component = null; Character = null; return; } Character = data.SpawnedInstance; Component = Character.GetComponentInChildren <T>(); }
public void SetCharacterData(CharacterMatchData data) { if (Image == null) return; if (data == null || data.Data == null) { Image.enabled = false; } else { Image.enabled = true; Image.sprite = data.Data.Icon; } }
public void SetCharacterData(CharacterMatchData data) { if (_text == null) { return; } if (data == null || data.Data == null) { _text.text = ""; } else { _text.text = ProcessName(data.Data.FirstName); } }
public void SetCharacterData(CharacterMatchData data) { if (Image == null) { return; } if (data == null || data.Data == null) { Image.enabled = false; } else { Image.enabled = true; Image.sprite = data.Data.LoadPortrait(data.Pallete); } }
public void SetCharacterData(CharacterMatchData data) { if (data == null) { return; } PlayerNumber = data.PlayerNumber; if (_graphic == null) { _graphic = GetComponent <Graphic>(); } if (_graphic) { _graphic.color = AdjustedColor; } }
void OnSpawn(CharacterMatchData data) { if (data == null || _displays.Count <= 0) { return; } GameObject display = null; while (_displays.Count > 0 && display == null) { display = _displays[0]; _displays.RemoveAt(0); } if (display == null) { return; } if (playerIndicatorPrefab != null) { PlayerIndicator indicator = playerIndicatorPrefab.InstantiateNew(); indicator.Target = data.SpawnedInstance; } _displays.Remove(display); display.SetActive(true); // Update the display with the Character information foreach (ICharacterGUIComponent component in display.GetComponentsInChildren <ICharacterGUIComponent>()) { component.SetCharacterData(data); } display.name = "Player " + (data.PlayerNumber + 1) + " Display"; }