public void GSDKStartCallback(string config)
        {
            GSDKUtils.Logger("config: " + config);
            string[] array = config.Split(new char[]
            {
                '|'
            });
            if (array.Length != 4)
            {
                return;
            }
            int    num     = 20;
            int    num2    = 3000;
            string message = array[1];
            int    num3;
            bool   flag = int.TryParse(array[0], out num3) && int.TryParse(array[2], out num) && int.TryParse(array[3], out num2);

            if (num3 != 0)
            {
                MonoBehaviour.print(message);
            }
            else if (flag && num > 0 && num2 >= 0)
            {
                GSDK.StartFps(0 - num, num2);
            }
        }
Example #2
0
 public static void Init(string appid, bool debug)
 {
     GSDKUtils.Logger("android init");
     GSDK.sGSDKPlatformClass = new AndroidJavaClass("com.tencent.gsdk.GSDKPlatform");
     GSDK.sGSDKPlatformClass.CallStatic("GSDKInit", new object[]
     {
         appid,
         debug
     });
     GSDK.sGSDKPlatformClass.CallStatic("GSDKSetObserver", new object[]
     {
         GSDKAndroidObserver.Instance
     });
 }
Example #3
0
        public static string EndSpeedWithKartinResult(string vip, int vport)
        {
            string result;

            try
            {
                string text = GSDK.sGSDKPlatformClass.CallStatic <string>("GSDKEndSpeed2", new object[]
                {
                    vip,
                    vport
                });
                GSDKUtils.Logger(text);
                result = text;
            }
            catch (Exception ex)
            {
                Debug.Log("catch ex " + ex.ToString());
                result = string.Empty;
            }
            return(result);
        }
Example #4
0
 public static void Init(string appid, bool debug, int zoneid)
 {
     try
     {
         GSDKUtils.isDebug = debug;
         GSDKUtils.Logger("gsdk mna init");
         GSDK.sGSDKPlatformClass = new AndroidJavaClass("com.tencent.gsdk.GSDKPlatform");
         AndroidJavaObject androidJavaObject = null;
         using (AndroidJavaClass androidJavaClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
         {
             androidJavaObject = androidJavaClass.GetStatic <AndroidJavaObject>("currentActivity");
         }
         if (GSDK.sGSDKPlatformClass != null)
         {
             androidJavaObject.Call("runOnUiThread", new object[]
             {
                 delegate
                 {
                     GSDK.sGSDKPlatformClass.CallStatic("GSDKInit", new object[]
                     {
                         appid,
                         debug,
                         zoneid
                     });
                     GSDK.sGSDKPlatformClass.CallStatic("GSDKSetObserver", new object[]
                     {
                         GSDKAndroidObserver.Instance
                     });
                 }
             });
         }
     }
     catch (Exception ex)
     {
         Debug.Log("catch ex " + ex.ToString());
     }
 }