Beispiel #1
0
 public static void ReadGameVersionInfo()
 {
     if (Util.HasKey("dhh_version"))
     {
         string   @string = Util.GetString("dhh_version");
         string[] array   = @string.Split(new char[]
         {
             '|'
         });
         if (array.Length >= 2)
         {
             int num            = Convert.ToInt32(array[0]);
             int appVersionCode = PlatformUtil.GetInstance().GetAppVersionCode();
             AppConst.GameVerCode = Mathf.Max(num, appVersionCode);
             if (appVersionCode > num)
             {
                 AppConst.GameVerName = PlatformUtil.GetInstance().GetAppVersionName();
             }
             else
             {
                 AppConst.GameVerName = array[1];
             }
         }
         else
         {
             AppConst.GameVerCode = PlatformUtil.GetInstance().GetAppVersionCode();
             AppConst.GameVerName = PlatformUtil.GetInstance().GetAppVersionName();
         }
     }
     else
     {
         AppConst.GameVerCode = PlatformUtil.GetInstance().GetAppVersionCode();
         AppConst.GameVerName = PlatformUtil.GetInstance().GetAppVersionName();
     }
 }
Beispiel #2
0
    public override void OnMessage(IMessage message)
    {
        string name = message.Name;
        object body = message.Body;
        string text = name;

        switch (text)
        {
        case "UpdateTipsContent":
            this.OnUpdateTipsContent(body.ToString());
            break;

        case "ExtractPackageFile":
            this.OnExtractPackageFile(body.ToString());
            break;

        case "UpdateDownloadProgress":
            this.OnDownloadProgress(body.ToString());
            break;

        case "UpdateCompleteEnterGame":
            if (Convert.ToBoolean(body))
            {
                this.txtVersion.text = string.Format("{0}_{1}_{2}", PlatformUtil.GetInstance().GetChannelId(), AppConst.GameVerName, AppConst.GameVerCode);
            }
            break;

        case "UpdateShowTips":
            this.OnShowUpdateTips(body);
            break;
        }
    }
Beispiel #3
0
        public static void OpenWebViewWithLocalFile(string filename, Rect viewRect, Action <bool> completeCallback)
        {
            string text = Util.DataPath + filename;

            if (Application.platform == RuntimePlatform.Android)
            {
                text = "file:///" + text;
            }
            PlatformUtil.GetInstance().OpenWebView(text, viewRect, completeCallback);
        }
Beispiel #4
0
    private static int GetInstance(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 0);
            PlatformUtil instance = PlatformUtil.GetInstance();
            ToLua.PushObject(L, instance);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
Beispiel #5
0
    private void InitView()
    {
        Util.ReadGameVersionInfo();
        Transform transform = base.transform.FindChild("SliderExtract");

        this.sliderExtractProgress   = transform.GetComponent <Slider>();
        this.txtVersion              = base.transform.FindChild("TxtVersion").GetComponent <Text>();
        this.txtVersion.text         = string.Format("{0}_{1}_{2}", PlatformUtil.GetInstance().GetChannelId(), AppConst.GameVerName, AppConst.GameVerCode);
        this.txtCheckUpdateTips      = base.transform.FindChild("ImgTips/TxtCheckTips").GetComponent <Text>();
        this.txtCheckUpdateTips.text = Util.GetDesConfig("requestGameConfigIng");
        this.transUpgradeTips        = base.transform.FindChild("ObjUpgradeTips");
        this.rectTransContent        = this.transUpgradeTips.FindChild("ScrollView/Viewport/Content").GetComponent <RectTransform>();
        this.txtUpdateTips           = this.transUpgradeTips.FindChild("ScrollView/Viewport/Content/Text").GetComponent <Text>();
        Button component = this.transUpgradeTips.FindChild("Button").GetComponent <Button>();

        component.onClick.RemoveAllListeners();
        component.onClick.AddListener(new UnityAction(this.OnBtnClickUpdate));
        Text component2 = base.transform.FindChild("ObjTips/TxtWarn").GetComponent <Text>();

        component2.text = Util.GetDesConfig("txtWarn");
        Text component3 = base.transform.FindChild("ObjTips/TxtInformation").GetComponent <Text>();

        component3.text = Util.GetDesConfig("txtInformation");
    }
Beispiel #6
0
 public static void OpenCamera(Action <string> completeCallback)
 {
     PlatformUtil.GetInstance().OpenCamera(completeCallback);
 }
Beispiel #7
0
 public static void OpenPhotoAlbum(Action <string> completeCallback)
 {
     PlatformUtil.GetInstance().OpenPhotoAlbum(completeCallback);
 }
Beispiel #8
0
 public static void StartRecording(Action <string> completeCallback)
 {
     PlatformUtil.GetInstance().StartRecording(completeCallback);
 }
Beispiel #9
0
 public static string GetXGPushToken()
 {
     return(PlatformUtil.GetInstance().GetXGPushToken());
 }
Beispiel #10
0
 public static void OpenWebView(string url, Rect viewRect, Action <bool> completeCallback)
 {
     Debug.Log("OpenWebView:" + url);
     PlatformUtil.GetInstance().OpenWebView(url, viewRect, completeCallback);
 }
Beispiel #11
0
 public static void CloseWebView()
 {
     PlatformUtil.GetInstance().CloseWebView();
 }
Beispiel #12
0
 public static void FinishRecording()
 {
     PlatformUtil.GetInstance().FinishRecording();
 }
 public void GenerateSessionId()
 {
     this.sessionId = PlatformUtil.GetInstance().GetSessionId(true);
 }
Beispiel #14
0
 public static void GetAudioDuration(string audioFile, Action <int> completeCallback)
 {
     PlatformUtil.GetInstance().GetAudioDuration(audioFile, completeCallback);
 }
Beispiel #15
0
 public static void TranslateAudio(string audioFile, Action <string> completeCallback)
 {
     PlatformUtil.GetInstance().TranslateAudio(audioFile, completeCallback);
 }
Beispiel #16
0
 public static void StopAduio()
 {
     PlatformUtil.GetInstance().StopAudio();
 }
Beispiel #17
0
 public static void PlayAudio(string audioFile)
 {
     PlatformUtil.GetInstance().PlayAudio(audioFile);
 }