Пример #1
0
	// Use this for initialization
	void Start ()
	{	
		ssdk = gameObject.GetComponent<ShareSDK>();
		ssdk.authHandler = AuthResultHandler;
		ssdk.shareHandler = ShareResultHandler;
		ssdk.showUserHandler = GetUserInfoResultHandler;
		ssdk.getFriendsHandler = GetFriendsResultHandler;
		ssdk.followFriendHandler = FollowFriendResultHandler;
	}
Пример #2
0
 static int set_ssdk(IntPtr L)
 {
     try
     {
         cn.sharesdk.unity3d.ShareSDK arg0 = (cn.sharesdk.unity3d.ShareSDK)ToLua.CheckUnityObject(L, 2, typeof(cn.sharesdk.unity3d.ShareSDK));
         weChatFunction.ssdk = arg0;
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Пример #3
0
    static int set_ssdk(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            SDKManager obj = (SDKManager)o;
            cn.sharesdk.unity3d.ShareSDK arg0 = (cn.sharesdk.unity3d.ShareSDK)ToLua.CheckUnityObject(L, 2, typeof(cn.sharesdk.unity3d.ShareSDK));
            obj.ssdk = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index ssdk on a nil value" : e.Message));
        }
    }
Пример #4
0
    static int get_ssdk(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            SDKManager obj = (SDKManager)o;
            cn.sharesdk.unity3d.ShareSDK ret = obj.ssdk;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index ssdk on a nil value" : e.Message));
        }
    }
Пример #5
0
        void Awake()
        {
            Instance = this;
            Type      type            = devInfo.GetType();
            Hashtable platformConfigs = new Hashtable();

            FieldInfo[] devInfoFields = type.GetFields();
            foreach (FieldInfo devInfoField in devInfoFields)
            {
                DevInfo     info       = (DevInfo)devInfoField.GetValue(devInfo);
                int         platformId = (int)info.GetType().GetField("type").GetValue(info);
                FieldInfo[] fields     = info.GetType().GetFields();
                Hashtable   table      = new Hashtable();
                foreach (FieldInfo field in fields)
                {
                    if ("type".EndsWith(field.Name))
                    {
                        continue;
                    }
                    else if ("Enable".EndsWith(field.Name) || "ShareByAppClient".EndsWith(field.Name) || "BypassApproval".EndsWith(field.Name))
                    {
                        table.Add(field.Name, Convert.ToString(field.GetValue(info)).ToLower());
                    }
                    else
                    {
                        table.Add(field.Name, Convert.ToString(field.GetValue(info)));
                    }
                }
                platformConfigs.Add(platformId, table);
            }

                        #if UNITY_ANDROID
            shareSDKUtils = new AndroidImpl(gameObject);
            shareSDKUtils.InitSDK(appKey, appSecret);
                        #elif UNITY_IPHONE
            shareSDKUtils = new iOSImpl(gameObject);
                        #endif

            shareSDKUtils.SetPlatformConfig(platformConfigs);
        }
Пример #6
0
 void Start()
 {
     GameObject.DontDestroyOnLoad(this.gameObject);
     instance = this;
 }