/// Setup the element with name, score and profile /// /// @param accountId /// Chilli Id - required to retrieve profile pic /// @param name /// Name to display /// @param profileUrl /// Picture to display /// @param score /// Highscore to display /// @param col /// Colour of the element /// public void Init(string accountId, string name, string profileUrl, int score, Color col) { m_name.text = name; m_score.text = score.ToString(); m_background.color = col; m_image.sprite = m_originalProfileSprite; //Fetch the profile pic ProfilePicSystem.Get().FetchProfilePicture(accountId, profileUrl, (texture) => { if (texture != null) { m_image.sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f)); } }); }
/// public ProfilePicSystem() { s_singletonInstance = this; }