123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- using cn.sharesdk.unity3d;
- public class Share : MonoBehaviour
- {
- #region 变量
- public ShareSDK ShareSdk;
- #endregion
- private void Awake()
- {
- ShareSdk.shareHandler = ShareCallback;
- ShareSdk.showUserHandler = AuthorizeCallback;
- }
- private void FixedUpdate()
- {
-
- }
- public void ShareTest()
- {
- ShareContent shareContent = new ShareContent();
- shareContent.SetText("SetText");
- shareContent.SetTitle("SetTitle");
- shareContent.SetSite("SetSite");
- shareContent.SetComment("SetComment");
- shareContent.SetShareType(ContentType.App);
- ShareSdk.ShowPlatformList(null, shareContent, 100, 100);
- }
- public void AuthorizeTest()
- {
- ShareSdk.Authorize(PlatformType.QQ);
- }
- public void ShareCallback(int reqID, ResponseState state, PlatformType type, Hashtable result)
- {
- if (state == ResponseState.Success)
- {
- print("Success");
- }
- else if (state == ResponseState.Fail)
- {
- print("Fail");
- }
- else if (state == ResponseState.Cancel)
- {
- print("Cancel");
- }
- }
- public void AuthorizeCallback(int reqID, ResponseState state, PlatformType type, Hashtable result)
- {
- if (state == ResponseState.Success)
- {
- print("Success");
- }
- else if (state == ResponseState.Fail)
- {
- print("Fail");
- }
- else if (state == ResponseState.Cancel)
- {
- print("Cancel");
- }
- }
- }
|