Unable to change the avatar app42

+2 votes

I am refering the Avatar Service from the App42.  I have got specific N number of avatars which I am creating at the time of first login now When the user wish he should be able to change the avatar from my specified N number of avatars. I do use the

avatarService.ChangeCurrentAvatar(userName,avatarName, new UnityCallBack());

and it gives the response to Is Current :True.

When I do quit the app and gain fetch the avatar the service gives me the last uploaded avtar. Please do help me to get the newer avatar.

Thank you


EDIT 1: Code Snippet

From AvatarScript

public void getCurrentAvatar(string name){
        if(name != null){
            avatarService.GetCurrentAvatar(name,avatarListener);
        }
 }

public void getCurrentAvatarTexture(string urlForAvatar,string nmOfAvatar){        StartCoroutine(fetchAvatar(urlForAvatar,nmOfAvatar));

    }

    IEnumerator fetchAvatar(string url,string nmOfAvatar1){
        WWW www=new WWW(url);
        yield return www;
        currentAvatar = (Texture2Dwww.texture;
        assignCurrentAvatar(currentAvatar,nmOfAvatar1);
    }

From Response Script

AvatarScript.sharedAvatarScript.getCurrentAvatarTexture(avatar.GetUrl(),avatar.GetName());

asked Apr 21, 2014 in AppWarp by marine.modi (62 points)
edited Apr 21, 2014 by marine.modi

1 Answer

0 votes

How do you fetching your current avatar ?

Use Get Current Avatar  in order to get your current avatar.

If you are using the same,  then some code snippet would be great help.

 

answered Apr 21, 2014 by Akshay.Mishra (179 points)
Thank you Akshay. Please do have a look on to the EDIT 1 for the code snippet.
You are doing well, i think may be its just because of your texture2D loading, it loads the old texture every time.

Or can you give me the running test sample of your avatar scripts, so that i'll figure out the problem. My Email is <Akshay.Mishra@shephertz.co.in>.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...