1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/chenxuejian-TJPackTool

В этом репозитории не указан файл с открытой лицензией (LICENSE). При использовании обратитесь к конкретному описанию проекта и его зависимостям в коде.
Клонировать/Скачать
TJSDK.cs 12 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
zhuhao Отправлено 10.04.2018 11:00 bd1798d
// SDK Version: 1
using System;
using System.Collections.Generic;
using TomatoJoy.TJAndroid.Ads;
using TomatoJoy.TJAndroid.Tools;
using TomatoJoy.TJIOS;
using TomatoJoy.Rate;
using TomatoJoy.GameCenter;
using UnityEngine.SocialPlatforms;
public class TJSDK : TJSDKBase
{
#region iOS
#region 支付
/// iOS支付
/// <param name="goodID">支付商品ID</param>
/// <param name="callBack">支付回调,第一个参数是商品ID,第二个参数表示支付是否成功</param>
public void PayIOS (string goodID, Action<string, bool> callBack)
{
base.PayIOS (goodID, callBack);
}
/// iOS恢复购买
/// <param name="callBack">支付回调,第一个参数是商品ID,第二个参数表示支付是否成功</param>
public void RestorePay (Action<string, bool> callBack)
{
base.RestorePay (callBack);
}
#endregion
#region 广告
#if UNITY_IPHONE || UNITY_IOS
/// 显示banner
public void ShowIOSBanner (CallBackInfo cb = null)
{
TJHeyzap.Instance.ShowBanner (cb);
}
/// 隐藏banner
public void HideBanner ()
{
TJHeyzap.Instance.HideBanner ();
}
/// 视频广告是否准备好
/// <returns><c>true</c> if this instance is video ready; otherwise, <c>false</c>.</returns>
public bool IsVideoReady ()
{
return TJHeyzap.Instance.IsVideoReady ();
}
/// 显示视频广告
public void ShowVideo ()
{
TJHeyzap.Instance.ShowVideo ();
}
/// 激励视频广告是否准备好
/// <returns><c>true</c> if this instance is incentivized ready; otherwise, <c>false</c>.</returns>
public bool IsIncentivizedReady ()
{
return TJHeyzap.Instance.IsIncentivizedReady ();
}
/// 显示激励视频
/// <param name="cb">Cb.</param>
public void ShowIncentivized (CallBackInfo cb)
{
TJHeyzap.Instance.ShowIncentivized (cb);
}
/// 插屏是否准备好
/// <returns><c>true</c> if this instance is interstitial ready; otherwise, <c>false</c>.</returns>
public bool IsInterstitialReady ()
{
return TJHeyzap.Instance.IsInterstitialReady ();
}
/// 显示插屏广告
/// <param name="cb">Cb.</param>
public void ShowInterstitial (CallBackInfo cb)
{
TJHeyzap.Instance.ShowInterstitial (cb);
}
#endif
#endregion
#region 分享
/// 平台授权 登陆平台
/// <param name="platform">媒体平台.</param>
/// <param name="callBack">授权回调, 第一参数是授权平台,第二个参数为错误码,第三个参数是授权获取信息</param>
public void AuthorizePlatform (Platform platform, Action<string, int, Dictionary<string, string>> callBack)
{
TJUmengShare.Instance.AuthorizePlatform (platform, callBack);
}
/// 取消平台授权 登出平台
/// <param name="platform">媒体平台.</param>
/// <param name="callBack">授权回调, 第一参数是授权平台,第二个参数为错误码,第三个参数是授权获取信息</param>
public void DeleteAuthorizePlatform (Platform platform, Action<string, int, Dictionary<string, string>> callBack)
{
TJUmengShare.Instance.DeleteAuthorizePlatform (platform, callBack);
}
/// 是否授权
/// <param name="platform">媒体平台.</param>
public bool IsAuthorized (Platform platform)
{
return TJUmengShare.Instance.IsAuthorized (platform);
}
#endregion
#region 本地推送
/// 移除本地推送 一般在启动游戏的时候
public void RemoveLocalNotification ()
{
LocalPush.Instance.CancelLocalNotification ();
}
/// 添加本地推送
public void AddLocalNotification (int notifyTime, string message)
{
LocalPush.Instance.RegisterLocalNotification (notifyTime, message);
}
#endregion
#endregion
#region Android
#region 统计相关
/// 统计事件
public void AnalyzeEvent (string event_name, Dictionary<string, string> dict = null)
{
base.AnalyzeEvent (event_name,dict);
}
/// 统计事件开始
public void AnalyzeEventBegin (string event_name)
{
base.AnalyzeEventBegin (event_name);
}
/// 统计事件结束
public void AnalyzeEventEnd (string event_name)
{
base.AnalyzeEventEnd (event_name);
}
/// 统计支付
/// <param name="price">价格.</param>
/// <param name="productDes">产品描述.</param>
/// <param name="productAmount">产品数量.</param>
public void AnalyzePay (string price, string productDes, string productAmount = null)
{
base.AnalyzePay (price, productDes, productAmount);
}
public void AnalyzeEconomy (string itemName, string itemAmount, string itemTotalPrice)
{
base.AnalyzeEconomy (itemName, itemAmount, itemTotalPrice);
}
public void AnalyzeQuest (string questId, string questStatu, string questType)
{
base.AnalyzeEconomy (questId, questStatu, questType);
}
#endregion
#region 广告相关
/// 广告回调
void OnADCallBack (string result)
{
base.OnADCallBack (result);
}
public void OnRecieveLog (string logStr)
{
base.OnRecieveLog (logStr);
}
/// 横幅状态
public bool IsBannerReady ()
{
return base.IsBannerReady ();
}
/// 展示原生广告
public void ShowNative (Action<bool> act = null)
{
base.ShowNative (act);
}
/// 关闭原生广告
public void CloseNative ()
{
base.CloseNative ();
}
/// 展示唤醒
public void ShowAwake (Action<bool> act = null)
{
base.ShowAwake (act);
}
/// 移除广告
public void RemoveAd ()
{
base.RemoveAd ();
}
#endregion
#region 支付相关
/// Android支付
/// moneyAmount: 支付金额
/// productName: 显示在支付页面的商品名称
/// payCallBack: 支付回调,回调方法含有索引参数
public void PayAndroid (string moneyAmount, string productName, string productDesc, System.Action<bool> payCallBack)
{
base.PayAndroid (moneyAmount,productName,productDesc,payCallBack);
}
/// 支付回调接收
void OnPayResult (string result)
{
TJLog ("支付回调:" + result);
pay.OnPayResult (result);
}
/// 登录
public void LoginPayAccount ()
{
TJLog ("登录");
pay.OnLoginGame ();
}
/// 切换账号
public void SwitchPayAccount ()
{
TJLog ("切换账号");
pay.OnSwitchAccount ();
}
#endregion
#region 地区屏蔽相关
public AdLocation.AdLocState GetAdLocState ()
{
return base.GetAdLocState ();
}
public void SetAdLocCallBack(Action act){
base.SetAdLocCallBack (act);
}
/// 地区屏蔽回调结果
void OnADLocCallBack (string result)
{
base.OnADLocCallBack (result);
}
#endregion
#region 唤醒提示相关
/// 唤醒提示时间
public void SetAwakeTime (int time)
{
awakeHint.SetTime (time);
}
/// 唤醒提示回调结果
void OnAwakeResult (string result)
{
awakeHint.OnAwakeResult (result);
}
#endregion
#region 番茄工具
public void OpenUrl(string url){
TJTools.Instance.OpenUrl (url);
}
public void OpenApp(string packageName){
TJTools.Instance.OpenApp (packageName);
}
public void OpenApp(string packageName,string activityName){
TJTools.Instance.OpenApp (packageName,activityName);
}
public void ShowToast(string message){
TJTools.Instance.ShowToast (message);
}
public void CopyString(string message){
TJTools.Instance.CopyString (message);
}
#endregion
#endregion
#region Same
#region 评价
/// 前往市场评价
/// <param name="channel">渠道.</param>
public void RateGame (RateApp.Channel channel)
{
RateApp.RateGame (channel);
}
#endregion
#region 分享相关
/// 分享(所有平台): content:分享内容, title:分享标题, imaPath:分享图片路径, url:分享地址, ac:分享回调
public void Share (string title, string content, string imagePath, string url, Action<bool> shareCallBack = null, Action closeCallBack = null)
{
base.Share (title,content,imagePath,url,shareCallBack,closeCallBack);
}
/// 分享(所有平台): title:分享标题, content:分享内容, imaPath:分享图片路径, url:分享地址, isSame:分享内容相同, ac:分享回调
public void Share (string title, string content, string imagePath, string url, bool isSame, Action<bool> act = null)
{
base.Share (title,content,imagePath,url,isSame,act);
}
/// 分享(指定平台): platform:分享平台, title:分享标题, content:分享内容, imaPath:分享图片路径, url:分享地址, ac:分享回调
public void Share (Platform platform, string title, string content, string imagePath, string url, Action<bool> act = null)
{
base.Share (platform,title,content,imagePath,url,act);
}
/// 设置分享(设置单个平台内容): platform:分享平台, title:分享标题, content:分享内容, imaPath:分享图片路径, url:分享地址
public void SetShare (Platform platform, string title, string content, string imagePath, string url)
{
base.SetShare (platform,title,content,imagePath,url);
}
/// 分享回调结果
void OnShareResult (string result)
{
share.OnShareResult (result);
}
#endregion
#region GameCenter
/// GameCenter认证
/// <param name="onDone">回调,返回是否认证成功标志.</param>
public void AuthenticateGameCenter (CallBackInfo cb = null)
{
TJGameCenter.AuthenticateGameCenter (cb);
}
/// 加载GameCenter成就
/// </summary>
public void LoadAchievements (Action<IAchievement[]> onDone = null)
{
TJGameCenter.LoadAchievements (onDone);
}
/// 上传成就进度
public void ReportProgress (string achievementId, double progress, Action<bool> onDone = null)
{
TJGameCenter.ReportProgress (achievementId, progress, onDone);
}
/// 显示GameCenter成就
public void ShowAchievements ()
{
TJGameCenter.ShowAchievements ();
}
/// 上传排行榜分数
public void ReportScore (string leaderboardId, long score)
{
TJGameCenter.ReportScore (leaderboardId, score);
}
/// <summary>
/// 显示GameCenter排行榜
/// </summary>
public void ShowLeaderboard ()
{
TJGameCenter.ShowLeardBoard ();
}
#endregion
#region 广告
/// 展示横幅
public void ShowBanner (Action<bool> act = null, CallBackInfo cb = null)
{
TJLog ("展示横幅广告");
base.ShowBanner (act, cb);
}
/// 关闭横幅
public void CloseBanner ()
{
TJLog ("关闭横幅广告");
base.CloseBanner ();
}
/// 插屏状态
public bool IsInsertReady ()
{
TJLog ("判断插屏广告状态");
return base.IsInsertReady ();
}
/// 激励插屏状态
public bool IsIncentInsertReady ()
{
TJLog ("判断激励插屏广告状态");
return base.IsIncentInsertReady ();
}
/// 插屏状态
public bool IsInsertReady (Type type)
{
TJLog ("判断插屏广告状态");
return base.IsInsertReady (type);
}
/// 展示插屏
public void ShowInsert (Action<bool> act = null, CallBackInfo cb = null)
{
TJLog ("展示插屏");
base.ShowInsert (act, cb);
}
/// 展示激励插屏
public void ShowIncentInsert (Action<bool> act = null, CallBackInfo cb = null)
{
TJLog ("展示激励插屏");
base.ShowIncentInsert (act, cb);
}
/// 展示插屏
public void ShowInsert (Type type, Action<bool> act = null, CallBackInfo cb = null)
{
TJLog ("展示插屏");
base.ShowInsert (type, act, cb);
}
/// 激励广告状态
public bool IsIncentReady ()
{
TJLog ("判断激励广告状态");
return base.IsIncentReady ();
}
/// 展示激励广告
public void ShowIncent (Action<bool> act = null, CallBackInfo cb = null)
{
TJLog ("展示激励广告");
base.ShowIncent (act, cb);
}
#endregion
#region 支付
/// 支付
/// moneyAmount: 支付金额
/// productName: 显示在支付页面的商品名称
/// payCallBack: 支付回调,回调方法含有索引参数
/// goodID: 支付商品ID
/// callback: 支付回调,第一个参数是商品ID,第二个参数表示支付是否成功
public void Pay (string moneyAmount, string productName, string productDesc, System.Action<bool> payCallBack = null, string goodID = null, Action<string, bool> callBack = null)
{
base.Pay (moneyAmount,productName,productDesc,payCallBack,goodID,callBack);
}
#endregion
#region 退出游戏
/// 退出游戏
public void QuitGame ()
{
base.QuitGame ();
}
void OnDestroy ()
{
base.OnDestroy ();
}
#endregion
#endregion
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/chenxuejian-TJPackTool.git
git@api.gitlife.ru:oschina-mirror/chenxuejian-TJPackTool.git
oschina-mirror
chenxuejian-TJPackTool
chenxuejian-TJPackTool
master