예제 #1
0
    public void OnClickShare()
    {
        if (false == GameManager.gameManager.PlayerDataPool.IsServerFlagOpen(SERVER_FLAGS_ENUM.FLAG_SNS))
        {
            return;
        }

        Tab_ShareReward reward = TableManager.GetShareRewardByID((int)m_nShareType, 0);

        if (null == reward)
        {
            LogModule.ErrorLog("OnClickShare::ShareType Invalid");
            return;
        }
        CG_SNS_SHARE packet = (CG_SNS_SHARE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_SNS_SHARE);

        packet.Sharetype = (int)ShareType.ShareType_NanGua;
        packet.SendPacket();

        string str = StrDictionary.GetClientDictionaryString("#{3245}", "",
                                                             Utils.GenServerNameWithSelfGuid(), Utils.GenCodeWithSelfGuid(ShareType.ShareType_NanGua));

        PlatformHelper.ShowSocialShareCenter(str);

        ClearUp();
        UIManager.CloseUI(UIInfo.ShareRoot);
    }
예제 #2
0
    void SetShareType(ShareType nShareType, OpenType nOpenType)
    {
        if (PlayerFrameLogic.Instance() != null)
        {
            PlayerFrameLogic.Instance().PlayerFrameHeadOnClick();
        }
        ClearUp();
        m_nShareType = nShareType;
        m_nOpenType  = nOpenType;

        int JoinSet = 0, shareSet = 0;

        for (int i = 0; i < REWARD_ITEMCOUNT_MAX; i++)
        {
            Tab_ShareReward reward = TableManager.GetShareRewardByID((int)m_nShareType, 0);
            if (null == reward)
            {
                continue;
            }
            int nTargetType = reward.GetTargetTypebyIndex(i);
            int nItemID     = reward.GetItemDataIdbyIndex(i);
            if ((int)RewardTargetType.TARGETTYPE_JOIN_USER == nTargetType)
            {
                if (JoinSet < m_JoinRewardItem.Length)
                {
                    m_JoinRewardItem[JoinSet].InitItem(nItemID);
                    JoinSet++;
                }
            }
            else if ((int)RewardTargetType.TARGETTYPE_SHARE_USER == nTargetType)
            {
                if (shareSet < m_ShareRewardItem.Length)
                {
                    m_ShareRewardItem[shareSet].InitItem(nItemID);
                    shareSet++;
                }
            }
        }

        if (OpenType.OpenType_ActiviteCode == m_nOpenType)
        {
            m_ActiviteGameObject.SetActive(true);
        }
        else if (OpenType.OpenType_Share == m_nOpenType)
        {
            m_ShareGameObject.SetActive(true);
        }
        else
        {
            LogModule.ErrorLog("ShareWindow OpenType Invalid");
        }
        if (ShareType.ShareType_NanGua == m_nShareType)
        {
            m_labelDesc.text = StrDictionary.GetClientDictionaryString("#{3102}");
            UpdateRewardCount();
        }
    }