BindProfilePic (Unity)
- Declaration
public static IDisposable BindProfilePic(this CavrnusUser user, MonoBehaviour ob, Action<Sprite> onProfilePicChanged)
- Description
Throws a Sprite event whenever the user’s profile pic is updated. Since loading the picture is always an asynchronous operation we have elected not to include a Get() function for this.
Note: Under-the-hood this is actually just calling: user.SpaceConnection.GetStringPropertyValue(user.ContainerId, "profilePicture");
Then we kick off a Unity Coroutine to turn that profile pic url into a Sprite. The ob parameter is there to provide the Coroutine a context to run in.
Since "profilePicture"
is a well-known value assigned by the server, we wrote this function as a helpful convenience.
NOTE: Since this value is representing data coming from outside the Properties system it cannot be assigned to, only read. Currently, user profile pics can only be modified in the Management Console, using the User Management Tools.
- Sample
Â