private void AddPlayerRender(PlayerStat playerStat) { PlayerStatUI prefab; switch (playerStat.Rel) { case RelType.Self: prefab = selfPlayerStatPrefab; break; case RelType.Friend: prefab = friendPlayerStatPrefab; break; case RelType.NextRank: prefab = nextrankPlayerStatPrefab; break; default: prefab = playerStatPrefab; break; } PlayerStatUI playerStatUI = Instantiate(prefab, globalBroad); playerStatUI.Set(playerStat); }
private void Start() { if (instance == null) { instance = this; } else if (instance != this) { Debug.LogError("Duplicate " + this.GetType().Name); Destroy(gameObject); } gameObject.SetActive(false); }