예제 #1
0
    void InitSweepTweenNumber(int nNumber, TweenNumber tweenNum, UILabel labelNum, TweenNumber.OnUpdatingNumDelegate RefreshLabelText)
    {
        int nFromNum = 0;
        int nToNum   = nNumber;

        labelNum.text          = "0";
        tweenNum               = TweenNumber.Begin(labelNum.gameObject, 2, nFromNum, nToNum);
        tweenNum.onUpdatingNum = RefreshLabelText;
    }
예제 #2
0
    void UpdateSweepAwardFellowExp_Num(Tab_StoryCopySceneAward tSweepAward, int nCount)
    {
        if (tSweepAward == null)
        {
            return;
        }

        int nAwardFellowExp  = tSweepAward.FellowExp;
        int FellowExpFromNum = 0;
        int FellowExpToNum   = nAwardFellowExp * nCount;

        m_FellowExp.text         = "0";
        m_FellowExpTweenNumLable = TweenNumber.Begin(m_FellowExp.gameObject, 2, FellowExpFromNum, FellowExpToNum);
        m_FellowExpTweenNumLable.onUpdatingNum = RefreshFellowExpLabelText;
    }
예제 #3
0
    void UpdateSweepAwardCoin(Tab_StoryCopySceneAward tSweepAward, int nCount)
    {
        if (tSweepAward == null)
        {
            return;
        }

        int nAwardCoin  = tSweepAward.Coin;
        int CoinFromNum = 0;
        int CoinToNum   = nAwardCoin * nCount;

        m_Coin.text     = "0";
        m_TweenNumLable = TweenNumber.Begin(m_Coin.gameObject, 2, CoinFromNum, CoinToNum);
        m_TweenNumLable.onUpdatingNum = RefreshCoinLabelText;
    }
예제 #4
0
    void Update()
    {
        if (m_bExpPlay)
        {
            if (m_nExpCurStep >= 0 && m_nExpCurStep < m_ExpTweenNumList.Count)
            {
                m_bExpPlay     = false;
                m_TweenSlider1 = TweenNumber.Begin(m_ExpSlider.gameObject, 2, m_ExpTweenNumList[m_nExpCurStep].From, m_ExpTweenNumList[m_nExpCurStep].To);
                m_TweenSlider1.onUpdatingNum = RefreshSlider1;
            }
        }

        if (m_bFellowExpPlay)
        {
            if (m_nFellowExpCurStep >= 0 && m_nFellowExpCurStep < m_FellowExpTweenNumList.Count)
            {
                m_bFellowExpPlay             = false;
                m_TweenSlider2               = TweenNumber.Begin(m_FellowExpSlider.gameObject, 2, m_FellowExpTweenNumList[m_nFellowExpCurStep].From, m_FellowExpTweenNumList[m_nFellowExpCurStep].To);
                m_TweenSlider2.onUpdatingNum = RefreshSlider2;
            }
        }
    }
    void InitLeft(Tab_StoryCopyScene tBook, bool bWin)
    {
        if (!bWin)
        {
            return;
        }

        int nAwardExp  = 0;
        int nAwardCoin = 0;
        int nAwardFExp = 0;
//		int nAwardYB = 0;

        Tab_StoryCopySceneAward tabPassReward = TableManager.GetStoryCopySceneAwardByID(tBook.PassReward, 0);

        if (null != tabPassReward)
        {
            nAwardCoin = tabPassReward.Coin;
            nAwardExp  = tabPassReward.Exp;
            nAwardFExp = tabPassReward.FellowExp;
//			nAwardYB = tabPassReward.BindYuanBao;
            for (int nIndex = 0; nIndex < tabPassReward.getItemIDCount(); ++nIndex)
            {
                int nPassIndex = nIndex + 3;
                if (m_BonusItem.Length <= nPassIndex)
                {
                    break;
                }
                int nPassRewardItemID  = tabPassReward.GetItemIDbyIndex(nIndex);
                int nPassRewardItemNum = tabPassReward.GetItemNumbyIndex(nIndex);
                if (0 < nPassRewardItemID && 0 < nPassRewardItemNum)
                {
                    m_BonusItem[nPassIndex].gameObject.SetActive(true);
                    m_BonusItem[nPassIndex].SetShowItem(nPassRewardItemID, nPassRewardItemNum, true, true);
                    //nAwardCount++;
                }
                else
                {
                    break;
                }
            }
        }

        int CoinFromNum = 0;
        int CoinToNum   = nAwardCoin;

        float FexpFromValue = GetCurLevelBattleFellowTotalExp() == 0 ? 0 : (float)(GetCurBattleFellowExp() - nAwardFExp) / GetCurLevelBattleFellowTotalExp();
        float FexpToValue   = GetCurLevelBattleFellowTotalExp() == 0 ? 0 : (float)GetCurBattleFellowExp() / GetCurLevelBattleFellowTotalExp();

        float ExpFromValue = (float)(GetCurPlayerExp() - nAwardExp) / GetCurLevelPlayerTotalExp();
        float ExpToValue   = (float)(GetCurPlayerExp()) / GetCurLevelPlayerTotalExp();

        //因为宠物经验在目前游戏计算有问题,所以按照策划意思,先写死,有个效果
        FexpFromValue = 0.4f;
        FexpToValue   = 0.7f;

        m_TweenNumLable = TweenNumber.Begin(m_Coin.gameObject, 2, CoinFromNum, CoinToNum);
        m_TweenNumLable.onUpdatingNum = RefreshLabelText;

        m_ExpSlider.value            = getSliderValue(ExpFromValue);
        m_TweenSlider1               = TweenNumber.Begin(m_ExpSlider.gameObject, 2, ExpFromValue, ExpToValue);
        m_TweenSlider1.onUpdatingNum = RefreshSlider1;

        m_FexpSlider.value           = getSliderValue(FexpFromValue);
        m_TweenSlider2               = TweenNumber.Begin(m_FexpSlider.gameObject, 2, FexpFromValue, FexpToValue);
        m_TweenSlider2.onUpdatingNum = RefreshSlider2;
        //m_Coin.text = nAwardCoin.ToString();
        //m_Exp.text = nAwardExp.ToString();
        //m_FExp.text = nAwardFExp.ToString();
        //m_BindYuanbao.text = nAwardYB.ToString();
    }