Ejemplo n.º 1
0
    public void showTestResult()
    {
        bool win = false;

        if (_curRightNums >= 10)
        {
            SceneMgr.getInstance().showSucceedLayer(3, 300);
            UserData.getInstance().addGoldNum(300);
            UserData.getInstance().addHappinessNum(HappyChangeEvent.PassThreeStars);

            _playerAniMgr.GetComponent <PlayerAniMgr>().playSucceed();

            AchievementMgr.getCurAchievementMgr().addAchievementNum(AchievementType.ACHIEVE_PERFECT_PASS, 1);
            AchievementMgr.getCurAchievementMgr().addAchievementNum(AchievementType.ACHIEVE_GETSTART, 3);
            AchievementMgr.getCurAchievementMgr().addAchievementNum(AchievementType.ACHIEVE_PASS, 1);

            win = true;
        }
        else if (_curRightNums >= 9)
        {
            SceneMgr.getInstance().showSucceedLayer(2, 200);
            UserData.getInstance().addGoldNum(200);
            UserData.getInstance().addHappinessNum(HappyChangeEvent.PassTwoStars);

            _playerAniMgr.GetComponent <PlayerAniMgr>().playSucceed();

            AchievementMgr.getCurAchievementMgr().addAchievementNum(AchievementType.ACHIEVE_GETSTART, 2);
            AchievementMgr.getCurAchievementMgr().addAchievementNum(AchievementType.ACHIEVE_PASS, 1);

            win = true;
        }
        else if (_curRightNums >= 7)
        {
            SceneMgr.getInstance().showSucceedLayer(1, 100);
            UserData.getInstance().addGoldNum(100);
            UserData.getInstance().addHappinessNum(HappyChangeEvent.PassOneStars);

            _playerAniMgr.GetComponent <PlayerAniMgr>().playSucceed();

            AchievementMgr.getCurAchievementMgr().addAchievementNum(AchievementType.ACHIEVE_GETSTART, 1);
            AchievementMgr.getCurAchievementMgr().addAchievementNum(AchievementType.ACHIEVE_PASS, 1);

            win = true;
        }
        else
        {
            SceneMgr.getInstance().showFailedLayer(10 - _curRightNums);
            UserData.getInstance().addHappinessNum(HappyChangeEvent.FailedPass);

            _playerAniMgr.GetComponent <PlayerAniMgr>().playFailed();

            AchievementMgr.getCurAchievementMgr().addAchievementNum(AchievementType.ACHIEVE_FAILED_TIMES, 1);
        }

        if (win && _curFileIdx == UserData.getInstance().getCurChapterIdx())
        {
            UserData.getInstance().setCurChapterIdx(_curFileIdx + 1);
        }
    }
Ejemplo n.º 2
0
    void initItems()
    {
        var temp = AchievementMgr.getCurAchievementMgr().getSortList();

        for (int i = 0; i < temp.Count; i++)
        {
            if (temp[i].compliteday != -1)
            {
                var item = Instantiate(_acievenItemObject);
                item.transform.SetParent(_showItemLayer.transform);
                item.transform.localScale = new Vector3(1f, 1f, 1f);

                var itemsprite = item.transform.GetChild(0).gameObject.GetComponent <Image>();
                itemsprite.sprite = Resources.Load <Sprite>("ui/achieve/achieve_name_" + temp[i].id);
                itemsprite.SetNativeSize();
            }
        }
    }
Ejemplo n.º 3
0
    public void RemoveWrongSelect()
    {
        if (_wrongSeletIdxArr.Count == 0)
        {
            return;
        }

        int idx       = Random.Range(0, _wrongSeletIdxArr.Count);
        int removeidx = _wrongSeletIdxArr[idx];

        _wrongSeletIdxArr.RemoveAt(idx);

        var line = Instantiate(_removeSelectLineObject);

        line.transform.SetParent(questionText.transform.parent);
        line.transform.localScale    = new Vector3(1f, 1f, 1f);
        line.transform.localPosition = answers[removeidx].transform.localPosition + new Vector3(-270f, 0f, 0f);
        _lineObjects.Add(line);

        (answers[removeidx]).raycastTarget = false;

        AchievementMgr.getCurAchievementMgr().addAchievementNum(AchievementType.ACHIEVE_REMIND_TIME, 1);
    }