Ejemplo n.º 1
0
    //方法,分享链接按钮被点击之后的操作
    public void ShareLinkButtonClick()
    {
        //如果道具界面响应点击
        if (propertyInterfaceClickEnable)
        {
            //播放按钮音效
            MyClass.AudioPlay(soundPlayer, Resources.Load <AudioClip>("Audio/Button"), MyClass.soundEnable);

            //如果本地化语言为中文
            if (MyClass.localizationLanguageIndex == 0)
            {
                //微信分享送道具的奖励激活
                MyClass.weChatShareRewardEnable = 1;

                #if (IOS_SDK)
                //微信分享
                SdkToU3d.WeChatShare();

                //按钮追踪
                SdkToU3d.TrackButtonActionWithName("WeChatShareButton");
                #endif
            }

            //否则
            else
            {
                //facebook分享送道具的奖励激活
                MyClass.facebookShareRewardEnable = 1;

                #if (IOS_SDK)
                //Facebook分享
                SdkToU3d.FacebookShare();

                //按钮追踪
                SdkToU3d.TrackButtonActionWithName("FacebookShareButton");
                #endif
            }
        }
    }