private void OnLeaderBoardsLoaded(CEvent e)
    {
        GooglePlayManager.instance.removeEventListener(GooglePlayManager.LEADERBOARDS_LOADED, OnLeaderBoardsLoaded);

        GooglePlayResult result = e.data as GooglePlayResult;

        if (result.isSuccess)
        {
            if (GooglePlayManager.instance.GetLeaderBoard(LEADERBOARD_ID) == null)
            {
                AN_PoupsProxy.showMessage("Leader boards loaded", LEADERBOARD_ID + " not found in leader boards list");
                return;
            }


            SA_StatusBar.text = LEADERBOARD_NAME + "  score  " + GooglePlayManager.instance.GetLeaderBoard(LEADERBOARD_ID).GetCurrentPlayerScore(GPBoardTimeSpan.ALL_TIME, GPCollectionType.FRIENDS).score.ToString();
            AN_PoupsProxy.showMessage(LEADERBOARD_NAME + "  score", GooglePlayManager.instance.GetLeaderBoard(LEADERBOARD_ID).GetCurrentPlayerScore(GPBoardTimeSpan.ALL_TIME, GPCollectionType.FRIENDS).score.ToString());
        }
        else
        {
            SA_StatusBar.text = result.message;
            AN_PoupsProxy.showMessage("Leader-Boards Loaded error: ", result.message);
        }

        UpdateBoardInfo();
    }
    private void OnAchievementsLoaded(GooglePlayResult result)
    {
        GooglePlayManager.ActionAchievementsLoaded -= OnAchievementsLoaded;
        if (result.IsSucceeded)
        {
            foreach (GPAchievement achievement in GooglePlayManager.Instance.Achievements)
            {
                Debug.Log(achievement.Id);
                Debug.Log(achievement.Name);
                Debug.Log(achievement.Description);
                Debug.Log(achievement.Type);
                Debug.Log(achievement.State);
                Debug.Log(achievement.CurrentSteps);
                Debug.Log(achievement.TotalSteps);
            }

            SA_StatusBar.text = "Total Achievement: " + GooglePlayManager.Instance.Achievements.Count.ToString();
            AN_PoupsProxy.showMessage("Achievments Loaded", "Total Achievements: " + GooglePlayManager.Instance.Achievements.Count.ToString());
        }
        else
        {
            SA_StatusBar.text = result.Message;
            AN_PoupsProxy.showMessage("Achievments Loaded error: ", result.Message);
        }
    }
    private void OnAchievementsLoaded(CEvent e)
    {
        GooglePlayManager.instance.removeEventListener(GooglePlayManager.ACHIEVEMENTS_LOADED, OnAchievementsLoaded);
        GooglePlayResult result = e.data as GooglePlayResult;

        if (result.isSuccess)
        {
            foreach (string achievementId in GooglePlayManager.instance.achievements.Keys)
            {
                GPAchievement achievement = GooglePlayManager.instance.GetAchievement(achievementId);
                Debug.Log(achievement.id);
                Debug.Log(achievement.name);
                Debug.Log(achievement.description);
                Debug.Log(achievement.type);
                Debug.Log(achievement.state);
                Debug.Log(achievement.currentSteps);
                Debug.Log(achievement.totalSteps);
            }

            SA_StatusBar.text = "Total Achievement: " + GooglePlayManager.instance.achievements.Count.ToString();
            AN_PoupsProxy.showMessage("Achievments Loaded", "Total Achievements: " + GooglePlayManager.instance.achievements.Count.ToString());
        }
        else
        {
            SA_StatusBar.text = result.message;
            AN_PoupsProxy.showMessage("Achievments Loaded error: ", result.message);
        }
    }
    private void OnAchievementUpdated(CEvent e)
    {
        GP_GamesResult result = e.data as GP_GamesResult;

        SA_StatusBar.text = "Achievment Updated: Id: " + result.achievementId + "\n status: " + result.message;
        AN_PoupsProxy.showMessage("Achievment Updated ", "Id: " + result.achievementId + "\n status: " + result.message);
    }
    IEnumerator DownloadImg(string URL, GameObject toNotify, string function)
    {
        Debug.Log("Loading image " + URL);

        AN_PoupsProxy.showMessage("Starting to load", "Succeeded, path: " + URL);
        loadingImage = true;

        GameObject loading = GameObject.FindWithTag("LoadingPopUp");

        loading.transform.GetChild(0).gameObject.SetActive(true);


        Texture2D texture = new Texture2D(1, 1);
        WWW       www     = new WWW(URL);

        yield return(www);

        www.LoadImageIntoTexture(texture);
        downloadedImage = texture;
        url             = URL;
        loadingImage    = false;
        loading.transform.GetChild(0).gameObject.SetActive(false);

        toNotify.SendMessage(function, texture);
        //  Common.infoGUI.pickResult.color = Color.white;
    }
 void OnGameRequestAccepted(List <GPGameRequest> gifts)
 {
     foreach (GPGameRequest g in gifts)
     {
         AN_PoupsProxy.showMessage("Gfit Accepted", g.playload + " is excepted");
     }
 }
Ejemplo n.º 7
0
    private void OnAchievementsLoaded(GooglePlayResult result)
    {
        GooglePlayManager.ActionAchievementsLoaded -= OnAchievementsLoaded;
        if (result.isSuccess)
        {
            foreach (string achievementId in GooglePlayManager.Instance.achievements.Keys)
            {
                GPAchievement achievement = GooglePlayManager.Instance.GetAchievement(achievementId);
                Debug.Log(achievement.id);
                Debug.Log(achievement.name);
                Debug.Log(achievement.description);
                Debug.Log(achievement.type);
                Debug.Log(achievement.state);
                Debug.Log(achievement.currentSteps);
                Debug.Log(achievement.totalSteps);
            }

            SA_StatusBar.text = "Total Achievement: " + GooglePlayManager.Instance.achievements.Count.ToString();
            AN_PoupsProxy.showMessage("Achievments Loaded", "Total Achievements: " + GooglePlayManager.Instance.achievements.Count.ToString());
        }
        else
        {
            SA_StatusBar.text = result.message;
            AN_PoupsProxy.showMessage("Achievments Loaded error: ", result.message);
        }
    }
    private void OnQuestsCompleted(GP_QuestResult result)
    {
        Debug.Log("Quests Completed, Reward: " + result.GetQuest().RewardData);

        AN_PoupsProxy.showMessage("On Quests Completed", "Quests Completed, Reward: " + result.GetQuest().RewardData);

        SA_StatusBar.text = "OnQuestsCompleted:  " + result.Response.ToString();
    }
Ejemplo n.º 9
0
    private void OnStateDeleted(CEvent e)
    {
        GoogleCloudManager.instance.removeEventListener(GoogleCloudManager.STATE_DELETED, OnStateDeleted);
        GoogleCloudResult result = e.data as GoogleCloudResult;


        AN_PoupsProxy.showMessage("KeyDeleted", result.message + "\n for state key: " + result.stateKey.ToString());
    }
 void LocaleInfoLoaded(AN_Locale locale)
 {
     AN_PoupsProxy.showMessage("Locale Indo:", locale.CountryCode + "/"
                               + locale.DisplayCountry + "  :   "
                               + locale.LanguageCode + "/"
                               + locale.DisplayLanguage);
     AndroidNativeUtility.LocaleInfoLoaded -= LocaleInfoLoaded;
 }
Ejemplo n.º 11
0
    private void OnInAppRequest(string productId)
    {
        AN_PoupsProxy.showMessage("In App Request", "In App Request for product Id: " + productId + " received");

        //Then you should perfrom purchase  for this product id, using this or another game billing plugin
        //Once the purchase is complete, you should call RecordInAppResolution with one of the constants defined in GADInAppResolution:

        AndroidAdMob.Client.RecordInAppResolution(GADInAppResolution.RESOLUTION_SUCCESS);
    }
Ejemplo n.º 12
0
    private void OnGameRequestAccepted(CEvent e)
    {
        List <GPGameRequest> gifts = e.data as List <GPGameRequest>;

        foreach (GPGameRequest g in gifts)
        {
            AN_PoupsProxy.showMessage("Gfit Accepted", g.playload + " is excepted");
        }
    }
 void ActionMatchUpdated(GP_TBM_UpdateMatchResult result)
 {
     // Match Date updated
     Debug_previous_method_name();
     unShowLoadingPopUp();
     AN_PoupsProxy.showMessage("ACTION match updated", "We got updated");
     DealWithMatchData(result.Match);
     //result.Match.Data
     // Common.roundInformation.gameData
 }
Ejemplo n.º 14
0
    void HandleActionGCMPushLaunched(string message, Dictionary <string, object> data)
    {
        Debug.Log("[HandleActionGCMPushLaunched]");
        Debug.Log("Message: " + message);
        foreach (KeyValuePair <string, object> pair in data)
        {
            Debug.Log("Data Entity: " + pair.Key + " " + pair.Value.ToString());
        }

        AN_PoupsProxy.showMessage(message, ANMiniJSON.Json.Serialize(data));
    }
Ejemplo n.º 15
0
    //--------------------------------------
    //  GET/SET
    //--------------------------------------

    //--------------------------------------
    //  EVENTS
    //--------------------------------------


    void HandleActionCMDRegistrationResult(GP_GCM_RegistrationResult res)
    {
        if (res.IsSucceeded)
        {
            AN_PoupsProxy.showMessage("Regstred", "GCM REG ID: " + GoogleCloudMessageService.instance.registrationId);
        }
        else
        {
            AN_PoupsProxy.showMessage("Reg Failed", "GCM Registration failed :(");
        }
    }
Ejemplo n.º 16
0
 private void OnImagePicked(AndroidImagePickResult result)
 {
     if (result.IsSucceeded)
     {
         //photoTexture = result.Image;
         applePhoto(result.Image);
     }
     else
     {
         AN_PoupsProxy.showMessage("Image Pick Rsult", "Failed");
     }
 }
    private void OnQuestsLoaded(GooglePlayResult result)
    {
        Debug.Log("Total Quests: " + GooglePlayQuests.Instance.GetQuests().Count);
        AN_PoupsProxy.showMessage("Quests Loaded", "Total Quests: " + GooglePlayQuests.Instance.GetQuests().Count);

        SA_StatusBar.text = "OnQuestsLoaded:  " + result.Response.ToString();

        foreach (GP_Quest quest in GooglePlayQuests.Instance.GetQuests())
        {
            Debug.Log(quest.Id);
        }
    }
Ejemplo n.º 18
0
    // --------------------------------------
    // Events
    // --------------------------------------

    private void OnIdsLoaded(TW_APIRequstResult result)
    {
        if (result.IsSucceeded)
        {
            AN_PoupsProxy.showMessage("Ids Request Succeeded", "Totals ids loaded: " + result.ids.Count);
            Debug.Log(result.ids.Count);
        }
        else
        {
            Debug.Log(result.responce);
            AN_PoupsProxy.showMessage("Ids Request Failed", result.responce);
        }
    }
    //--------------------------------------
    //  EVENTS
    //--------------------------------------

    private void OnStateConflict(GoogleCloudResult result)
    {
        AN_PoupsProxy.showMessage("OnStateUpdated", result.message
                                  + "\n State ID: " + result.stateKey
                                  + "\n State Data: " + result.stateData
                                  + "\n State Conflict: " + result.serverConflictData
                                  + "\n State resolve: " + result.resolvedVersion);

        //Resolving conflict with our local data
        //you should create your own resolve logic for your game. Read more about resolving conflict on Android developer website

        GoogleCloudManager.instance.resolveState(result.stateKey, result.stateData, result.resolvedVersion);
    }
    void OnPackageCheckResult(AN_PackageCheckResult res)
    {
        if (res.IsSucceeded)
        {
            AN_PoupsProxy.showMessage("On Package Check Result", "Application  " + res.packageName + " is installed on this device");
        }
        else
        {
            AN_PoupsProxy.showMessage("On Package Check Result", "Application  " + res.packageName + " is not installed on this device");
        }

        AndroidNativeUtility.OnPackageCheckResult -= OnPackageCheckResult;
    }
Ejemplo n.º 21
0
    private void OnImagePicked(AndroidImagePickResult result)
    {
        AndroidCamera.Instance.OnImagePicked -= OnImagePicked;

        if (result.IsSucceeded)
        {
            AN_PoupsProxy.showMessage("Image Pick Rsult", "Succeeded, path: " + result.ImagePath);
            pickedImage.GetComponent <Image> ().sprite = result.Image.ToSprite();
        }
        else
        {
            AN_PoupsProxy.showMessage("Image Pick Rsult", "Failed");
        }
    }
Ejemplo n.º 22
0
 void OnImageSaved(GallerySaveResult result)
 {
     AndroidCamera.instance.OnImageSaved -= OnImageSaved;
     if (result.IsSucceeded)
     {
         AN_PoupsProxy.showMessage("Saved", "Image saved to gallery \n" + "Path: " + result.imagePath);
         SA_StatusBar.text = "Image saved to gallery";
     }
     else
     {
         AN_PoupsProxy.showMessage("Failed", "Image save to gallery failed");
         SA_StatusBar.text = "Image save to gallery failed";
     }
 }
    void HandleActionAppInvitesSent(GP_SendAppInvitesResult res)
    {
        if (res.IsSucceeded)
        {
            Debug.Log("Invitation was sent to " + res.InvitationIds.Length + " people");
            AN_PoupsProxy.showMessage("Success", "Invitation was sent to " + res.InvitationIds.Length + " people");
        }
        else
        {
            Debug.Log("App invite failed" + res.Message);
            AN_PoupsProxy.showMessage("Fail", "App invite failed" + res.Message);
        }

        GP_AppInvitesController.ActionAppInvitesSent -= HandleActionAppInvitesSent;
    }
    private void OnPackageInfoLoaded()
    {
        AndroidAppInfoLoader.instance.removeEventListener(AndroidAppInfoLoader.PACKAGE_INFO_LOADED, OnPackageInfoLoaded);

        string msg = "";

        msg += "versionName: " + AndroidAppInfoLoader.instance.PacakgeInfo.versionName + "\n";
        msg += "versionCode: " + AndroidAppInfoLoader.instance.PacakgeInfo.versionCode + "\n";
        msg += "packageName" + AndroidAppInfoLoader.instance.PacakgeInfo.packageName + "\n";
        msg += "lastUpdateTime:" + System.Convert.ToString(AndroidAppInfoLoader.instance.PacakgeInfo.lastUpdateTime) + "\n";
        msg += "sharedUserId" + AndroidAppInfoLoader.instance.PacakgeInfo.sharedUserId + "\n";
        msg += "sharedUserLabel" + AndroidAppInfoLoader.instance.PacakgeInfo.sharedUserLabel;

        AN_PoupsProxy.showMessage("App Info Loaded", msg);
    }
    private void OnPackageInfoLoaded(PackageAppInfo PacakgeInfo)
    {
        AndroidAppInfoLoader.ActionPacakgeInfoLoaded -= OnPackageInfoLoaded;

        string msg = "";

        msg += "versionName: " + PacakgeInfo.versionName + "\n";
        msg += "versionCode: " + PacakgeInfo.versionCode + "\n";
        msg += "packageName" + PacakgeInfo.packageName + "\n";
        msg += "lastUpdateTime:" + System.Convert.ToString(PacakgeInfo.lastUpdateTime) + "\n";
        msg += "sharedUserId" + PacakgeInfo.sharedUserId + "\n";
        msg += "sharedUserLabel" + PacakgeInfo.sharedUserLabel;

        AN_PoupsProxy.showMessage("App Info Loaded", msg);
    }
    private void OnImagePicked(AndroidImagePickResult result)
    {
        Debug.Log("OnImagePicked");
        if (result.IsSucceeded)
        {
            AN_PoupsProxy.showMessage("Image Pick Rsult", "Succeeded, path: " + result.ImagePath);
            image.GetComponent <Renderer> ().material.mainTexture = result.Image;
        }
        else
        {
            AN_PoupsProxy.showMessage("Image Pick Rsult", "Failed");
        }

        AndroidCamera.Instance.OnImagePicked -= OnImagePicked;
    }
    //--------------------------------------
    // EVENTS
    //--------------------------------------

    private void OnEventsLoaded(GooglePlayResult result)
    {
        Debug.Log("Total Events: " + GooglePlayEvents.Instance.Events.Count);
        AN_PoupsProxy.showMessage("Events Loaded", "Total Events: " + GooglePlayEvents.Instance.Events.Count);
        SA_StatusBar.text = "OnEventsLoaded:  " + result.Response.ToString();

        foreach (GP_Event ev in GooglePlayEvents.Instance.Events)
        {
            Debug.Log(ev.Id);
            Debug.Log(ev.Description);
            Debug.Log(ev.FormattedValue);
            Debug.Log(ev.Value);
            Debug.Log(ev.IconImageUrl);
            Debug.Log(ev.icon);
        }
    }
Ejemplo n.º 28
0
    private void OnDialogClose(AndroidDialogResult result)
    {
        //parsing result
        switch (result)
        {
        case AndroidDialogResult.YES:
            Debug.Log("Yes button pressed");
            break;

        case AndroidDialogResult.NO:
            Debug.Log("No button pressed");
            break;
        }

        AN_PoupsProxy.showMessage("Result", result.ToString() + " button pressed");
    }
Ejemplo n.º 29
0
    private void OnTimeLineRequestComplete(TW_APIRequstResult result)
    {
        if (result.IsSucceeded)
        {
            string msg = "Last Tweet text:" + "\n";
            msg += result.tweets[0].text;

            AN_PoupsProxy.showMessage("Time Line Request Succeeded", msg);
            Debug.Log(msg);
        }
        else
        {
            Debug.Log(result.responce);
            AN_PoupsProxy.showMessage("Time Line Request Failed", result.responce);
        }
    }
Ejemplo n.º 30
0
    public int FindMyPlayerNumber(GameDataGooglePlay data, string idToFind)
    {
        int counter = 0;

        foreach (string id in data.playerIDS)
        {
            if (id.Contains(idToFind))
            {
                AN_PoupsProxy.showMessage("FindMyPlayerNumber in playerinformation", "found player number " + counter.ToString());
                return(counter);
            }
            counter++;
        }
        AN_PoupsProxy.showMessage("FindMyPlayerNumber didn't find player number", "Giving new pn " + counter.ToString());
        return(counter);
    }