Ejemplo n.º 1
0
    private void OnClickKTPlay(GameObject obj)
    {
//		string str ="101119" + Globals.Instance.MGameDataManager.MActorData.PlayerID.ToString();

                #if UNITY_ANDROID
        AndroidSDKAgent.OpenKTPlay();
                #endif

                #if UNITY_IPHONE
        //U3dAppStoreSender.OpenKTPlay();
                #endif
    }
    private void OnPressedShareBtn(GameObject obj)
    {
        // 最后将这些纹理数据,成一个png图片文件
        byte[] bytes    = texture2d.EncodeToPNG();
        string cptrAddr = "Screenshot" + System.DateTime.Now.Second.ToString() + ".png";
        string filename = Application.persistentDataPath + "/" + cptrAddr;

        System.IO.File.WriteAllBytes(filename, bytes);
        Debug.Log(string.Format("截屏了一张照片: {0}", filename));

        Globals.Instance.MTaskManager.IsGetShareReward = true;

        if (GameDefines.OutputVerDefs == OutputVersionDefs.AppStore)
        {
            //U3dAppStoreSender.ShareMyPhoto(filename);
        }
        else if (GameDefines.OutputVerDefs == OutputVersionDefs.WPay)
        {
            AndroidSDKAgent.showShare(filename);
        }
    }
    IEnumerator InvokeAndroidCameraSaveDelegate()
    {
        yield return(new WaitForSeconds(0.2f));

        // 最后将这些纹理数据,成一个png图片文件  //
        byte[] bytes    = texture2d.EncodeToPNG();
        string cptrAddr = "Screenshot" + System.DateTime.Now.Second.ToString() + ".png";
        string filename = Application.persistentDataPath + "/" + cptrAddr;

        try
        {
            System.IO.File.WriteAllBytes(filename, bytes);
            Debug.Log(string.Format("截屏了一张照片: {0}", filename));
            AndroidSDKAgent.SavePhoto(filename, cptrAddr);
            Debug.Log("----------------------" + filename);
        }
        catch
        {
            GUIRadarScan.Hide();
            Globals.Instance.MGUIManager.ShowSimpleCenterTips(10012);
        }
        yield return(0);
    }