Пример #1
0
    public void saveManager()
    {
        AndroidJavaObject persistanceManager = AGGameState.getPersistanceManager();

        if (persistanceManager != null)
        {
            persistanceManager.Call("saveResult", result);
        }
    }
Пример #2
0
    void updateChild()
    {
        Texture2D _childTexture = new Texture2D(1024, 768);

        byte [] data = AGGameState.getChildImage();

        if (data != null && data.Length > 0)
        {
            _childTexture.LoadImage(data);
        }
        else
        {
            _childTexture = defaultChildImage;
        }

        childImage.renderer.material.mainTexture = _childTexture;

        starCount.text = string.Format("{0}", AGGameState.getStarCount());
        string chName = AGGameState.getChildName();

        if (chName != null && !chName.Equals(childName.text))
        {
            double            timeSpent          = (double)(Time.time - AGGameState.startingTime);
            AndroidJavaObject persistanceManager = AGGameState.getPersistanceManager();
            persistanceManager.Call("addChildSessionTimeLog", (double)timeSpent);


            AGGameState.startingTime = Time.time;
        }
        if (chName == null || chName.Equals(""))
        {
            chName = "Child";
        }
        childName.text = chName;

        if (AGGameState.getChildCount() > 1)
        {
            childSwitchButton.SetActive(true);
        }
        else
        {
            childSwitchButton.SetActive(false);
        }
    }
Пример #3
0
    public CoreDataManager(int skillId)
    {
        skillID = skillId;

        AndroidJavaObject persistanceManager = AGGameState.getPersistanceManager();

        if (persistanceManager != null)
        {
            result = persistanceManager.Call <AndroidJavaObject>("getResultForCategoryId", skillID);

            currentLevel   = result.Call <int>("getCurrentLevel");
            totalLevels    = result.Call <int>("getTotalLevels");
            categoryStatus = result.Call <int>("getCategoryStatus");

            string dict = result.Call <string>("getResultDataDic");

            AGGameState.setChild(persistanceManager.Call <AndroidJavaObject>("getCurrentChild"));

            if (dict != null)
            {
                resultDict = MiniJSON.jsonDecode(dict) as Hashtable;
            }
        }
    }