public static void Send(byte[] rawData) { SDKMessage <byte[]> message = new SDKMessage <byte[]>(); message.data = rawData; WSSend(message); }
private void OnGUI() { float buttonWidth = Screen.width * 0.2f; float buttonHeight = Screen.height * 0.1f; float positionX = Screen.width / 2f - buttonWidth / 2f; if (GUI.Button(new Rect(positionX, Screen.height * 0.05f, buttonWidth, buttonHeight), "初始化")) { SDKManager.GetSingleton().IUnityToSDK.Init(); } if (GUI.Button(new Rect(positionX, Screen.height * 0.25f, buttonWidth, buttonHeight), "登入")) { SDKManager.GetSingleton().IUnityToSDK.Login(); } if (GUI.Button(new Rect(positionX, Screen.height * 0.45f, buttonWidth, buttonHeight), "上传数据")) { SDKMessage message = SDKConfig.GetUploadInfo(); SDKManager.GetSingleton().IUnityToSDK.UploadInfo(message); } if (GUI.Button(new Rect(positionX, Screen.height * 0.65f, buttonWidth, buttonHeight), "支付")) { SDKMessage message = SDKConfig.GetPayInfo(); SDKManager.GetSingleton().IUnityToSDK.Pay(message); } if (GUI.Button(new Rect(positionX, Screen.height * 0.85f, buttonWidth, buttonHeight), "补充方法")) { SDKMessage message = new SDKMessage((int)SDKMessageType.Method0); SDKManager.GetSingleton().IUnityToSDK.Other(message); } }
public static void Send(string data) { SDKMessage <string> message = new SDKMessage <string>(); message.data = data; WSSend(message); }
public static void Send <T>(T rawData) { SDKMessage <T> message = new SDKMessage <T>(); message.data = rawData; WSSend(message); }
public void Init() { SDKConfig.Log("Default_UnityToSDK : Init()"); SDKMessage message = new SDKMessage((int)SDKMessageType.Init); SDKManager.GetSingleton().UnityToSDK(message); }
public string Other(SDKMessage message) { SDKConfig.Log("Default_UnityToSDK : Other()"); if (message == null) { message = new SDKMessage((int)SDKMessageType.Method0); } return(SDKManager.GetSingleton().UnityToSDK(message)); }
public void Pay(SDKMessage message) { SDKConfig.Log("Default_UnityToSDK : Pay()"); if (message == null) { message = new SDKMessage((int)SDKMessageType.Pay); } SDKManager.GetSingleton().UnityToSDK(message); }
public void UploadInfo(SDKMessage message) { SDKConfig.Log("Default_UnityToSDK : UploadInfo()"); if (message == null) { message = new SDKMessage((int)SDKMessageType.UploadInfo); } SDKManager.GetSingleton().UnityToSDK(message); }
public void LoginSucceed(SDKMessage message) { if (message == null) { SDKConfig.Log("Default_SDKToUnity : LoginNotice() message == null"); return; } SDKConfig.Log("Default_SDKToUnity : LoginNotice() UserID : " + message.UserID); SDKConfig.LoginGame(message.UserID); }
/// <summary> /// 打印SDKMessage信息. /// </summary> /// <param name="message">Message.</param> public static void ShowSDKMessageInfo(SDKMessage message) { Log("SDKMessage : ShowSDKMessageInfo Type:" + message.Type); Log("SDKMessage : ShowSDKMessageInfo Money:" + message.Money); Log("SDKMessage : ShowSDKMessageInfo OrderId:" + message.OrderId); Log("SDKMessage : ShowSDKMessageInfo RechargeTime:" + message.RechargeTime); Log("SDKMessage : ShowSDKMessageInfo ProductID:" + message.ProductID); Log("SDKMessage : ShowSDKMessageInfo ProductName:" + message.ProductName); Log("SDKMessage : ShowSDKMessageInfo ProductDescription:" + message.ProductDescription); Log("SDKMessage : ShowSDKMessageInfo UploadInfoType:" + message.UploadInfoType); Log("SDKMessage : ShowSDKMessageInfo RoleId:" + message.RoleId); Log("SDKMessage : ShowSDKMessageInfo RoleName:" + message.RoleName); Log("SDKMessage : ShowSDKMessageInfo RoleLevel:" + message.RoleLevel); Log("SDKMessage : ShowSDKMessageInfo RoleProfessionalID:" + message.RoleProfessionalID); Log("SDKMessage : ShowSDKMessageInfo RoleProfessionalName:" + message.RoleProfessionalName); Log("SDKMessage : ShowSDKMessageInfo RolePower:" + message.RolePower); Log("SDKMessage : ShowSDKMessageInfo CreateRoleTime:" + message.CreateRoleTime); Log("SDKMessage : ShowSDKMessageInfo RoleUpgradeTime:" + message.RoleUpgradeTime); Log("SDKMessage : ShowSDKMessageInfo Diamond:" + message.Diamond); Log("SDKMessage : ShowSDKMessageInfo AreaId:" + message.AreaId); Log("SDKMessage : ShowSDKMessageInfo ArenName:" + message.ArenName); Log("SDKMessage : ShowSDKMessageInfo VIPLevel:" + message.VIPLevel); Log("SDKMessage : ShowSDKMessageInfo GangID:" + message.GangID); Log("SDKMessage : ShowSDKMessageInfo GangName:" + message.GangName); Log("SDKMessage : ShowSDKMessageInfo CompanyName:" + message.CompanyName); Log("SDKMessage : ShowSDKMessageInfo UserID:" + message.UserID); Log("SDKMessage : ShowSDKMessageInfo Variable0:" + message.Variable0); Log("SDKMessage : ShowSDKMessageInfo Variable1:" + message.Variable1); Log("SDKMessage : ShowSDKMessageInfo Variable2:" + message.Variable2); Log("SDKMessage : ShowSDKMessageInfo Variable3:" + message.Variable3); Log("SDKMessage : ShowSDKMessageInfo Variable4:" + message.Variable4); Log("SDKMessage : ShowSDKMessageInfo Variable5:" + message.Variable5); Log("SDKMessage : ShowSDKMessageInfo Variable6:" + message.Variable6); Log("SDKMessage : ShowSDKMessageInfo Variable7:" + message.Variable7); Log("SDKMessage : ShowSDKMessageInfo Variable8:" + message.Variable8); Log("SDKMessage : ShowSDKMessageInfo Variable9:" + message.Variable9); }
public string Other(SDKMessage message) { SDKConfig.Log("Default_SDKToUnity : Other()"); return("null"); }