Esempio n. 1
0
    public void InitGameObject(TipBox_0.TipBox_0_ZiTi ZiTiType, float LifeTime, tagItemOnce[] pItems, byte byCount)
    {
        Init_GameObj(true);
        BaseTranF.GetChild(1).GetComponent <UISprite>().spriteName = ZiTiType.ToString();
        m_goOk = BaseTranF.GetChild(2).gameObject;
        UIEventListener.Get(m_goOk).onClick = OnOK;
        m_goOk.SetActive(false);
        GlobalAudioMgr.Instance.PlayOrdianryMusic(Audio.OrdianryMusic.m_GoldJump);
        WndManager.Instance.Push(BaseTranF);
        for (int i = 0; i < byCount; i++)
        {
            m_goItem[i] = (GameObject)GameObject.Instantiate(m_objItem);
            m_goItem[i].SetActive(false);

            UISprite sp    = m_goItem[i].transform.GetChild(3).GetComponent <UISprite>();
            UILabel  label = m_goItem[i].transform.GetChild(1).GetComponent <UILabel>();

            sp.spriteName = FishConfig.Instance.m_ItemInfo.m_ItemMap[pItems[i].ItemID].ItemIcon;
            label.text    = pItems[i].ItemSum.ToString();


            if (byCount == 0)
            {
            }
            else if (byCount == 1)
            {
                m_goItem[i].transform.position = new Vector3(0f, -6.3f, 0f);
            }
            else if (byCount == 2)
            {
                if (i == 0)
                {
                    m_goItem[i].transform.position = new Vector3(-77f, -6.3f, 0f);
                }
                else if (i == 1)
                {
                    m_goItem[i].transform.position = new Vector3(77f, -6.3f, 0f);
                }
            }
            else if (byCount == 3)
            {
                if (i == 0)
                {
                    m_goItem[i].transform.position = new Vector3(-127f, -6.3f, 0f);
                }
                else if (i == 1)
                {
                    m_goItem[i].transform.position = new Vector3(0f, -6.3f, 0f);
                }
                else if (i == 2)
                {
                    m_goItem[i].transform.position = new Vector3(127f, -6.3f, 0f);
                }
            }
            m_goItem[i].transform.SetParent(BaseTranF.transform, false);
        }
        m_fElapsedTime   = 0;
        m_TipBoxLifeTime = LifeTime;// LifeTime;// m_fBgplay + f_fItemPlay * 3 + LifeTime;
    }
Esempio n. 2
0
    public void ShowTipBox_0(TipBox_0.TipBox_0_ZiTi ZiTiType, float LifeTime, ushort uRewardid1, ushort uRewardid2 = 0)
    {
        if (bShowTipBox_0)
        {
            return;
        }
        bShowTipBox_0 = true;
        //解析奖励
        tagItemOnce[] pItems = new tagItemOnce[3];
        for (int i = 0; i < pItems.Length; i++)
        {
            pItems[i] = new tagItemOnce();
        }
        byte          Index = 0;
        tagRewardOnce pReward;

        if (FishConfig.Instance.m_RewardConfig.RewardMap.TryGetValue(uRewardid1, out pReward))
        {
            for (byte i = 0; i < pReward.RewardItemVec.Count; i++)
            {
                if (Index < pItems.Length)
                {
                    pItems[Index++] = pReward.RewardItemVec[i];
                }
            }
        }
        if (FishConfig.Instance.m_RewardConfig.RewardMap.TryGetValue(uRewardid2, out pReward))
        {
            for (byte i = 0; i < pReward.RewardItemVec.Count; i++)
            {
                if (Index < pItems.Length)
                {
                    pItems[Index++] = pReward.RewardItemVec[i];
                }
            }
        }

        m_TipBox_0.InitGameObject(ZiTiType, LifeTime, pItems, Index);
        // ShowMask(true, 12);
    }