一、准备步骤:
1、登录ShareSDK官网,添加一个应用
2、登录微信公众平台,创建一个移动应用
3、新建一个Unity工程,按照Unity快速集成文档创建工程
二、编写简单测试代码并挂在MainCamera上:
using UnityEngine;
using System.Collections;
using cn.sharesdk.unity3d;
using System;
public class ShareSDKTest : MonoBehaviour {
public ShareSDK ssdk;
// Use this for initialization
private void Start () {
ssdk = gameObject.GetComponent<ShareSDK>();
ssdk.shareHandler = OnShareResultHandler;
}
private void OnGUI()
{
if(GUI.Button(new Rect(100, 100, 100, 50), "Share"))
{
ShareContent content = new ShareContent();
content.SetText("this is a test string.");
content.SetImagePath(Application.persistentDataPa