コード例 #1
0
    // http://wiki.unity3d.com/index.php/ScreenCapture
    private IEnumerator SaveScreenShot()
    {
        yield return(new WaitForEndOfFrame());

        string filePath = Application.persistentDataPath + "/GLShareImage.png";

        //Create a texture to pass to encoding
        Texture2D texture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false);

        //Put buffer into texture
        texture.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0);

        //Split the process up--ReadPixels() and the GetPixels() call inside of the encoder are both pretty heavy
        yield return(0);

        byte[] bytes = texture.EncodeToPNG();

        //Save our test image (could also upload to WWW)
        File.WriteAllBytes(filePath, bytes);

        //Tell unity to delete the texture, by default it seems to keep hold of it and memory crashes will occur after too many screenshots.
        DestroyObject(texture);

        GLink.sharedInstance().executeArticlePostWithImage(filePath);
    }
コード例 #2
0
 public void OnClickGlinkButton()
 {
     // GLinkNaverId.sharedInstance().init("197CymaStozo7X5r2qR5", "evCgKH1kJL");
     // GLinkNaverId.sharedInstance().login();
     GLink.sharedInstance().setWidgetStartPosition(false, 60);
     GLink.sharedInstance().executeHome();
 }
コード例 #3
0
    void Start()
    {
        GLink.sharedInstance().init(CafeId, NaverLoginClientId, NaverLoginClientSecret);

        if (SupportGlobal)
        {
            GLink.sharedInstance().initGlobal(ConsumerKey, ConsumerSecureKey, CommunityNo, LoungeNo);
        }
    }
コード例 #4
0
 void Start()
 {
     GLink.sharedInstance().init(LoungeId, NaverLoginClientId, NaverLoginClientSecret);
     GLinkDelegate.sdkCallInGameMenuCode += code =>
     {
         GLink.sharedInstance().terminateSdk();
         Debug.Log("CallInGameMenuCode : " + code);
     };
 }
コード例 #5
0
    public void executeCaptureScreenshopAndPostArticle(string dummy)
    {
        // For iOS , For Widget
        // Game ScreenShot Code
        StartCoroutine(this.CoFunction());

        Texture2D image = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false);

        image.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0, true);
        image.Apply();

        byte[] bytes = image.EncodeToPNG();
        string path  = Application.persistentDataPath + "/GLShareImage.png";

        File.WriteAllBytes(path, bytes);

        GLink.sharedInstance().executeArticlePostWithImage(5, "", "", path);
    }
コード例 #6
0
 public void OnClickGlinkButton()
 {
     GLink.sharedInstance().setWidgetStartPosition(false, 60);
     GLink.sharedInstance().executeHome();
 }
コード例 #7
0
 public void OnClickGlinkButton()
 {
     GLink.sharedInstance().executeHome();
 }
コード例 #8
0
 public void gotoProfile()
 {
     GLink.sharedInstance().executeProfile();
 }
コード例 #9
0
 public void gotoEvnet()
 {
     GLink.sharedInstance().executeEvent();
 }
コード例 #10
0
 public void gotoNotice()
 {
     GLink.sharedInstance().executeNotice();
 }
コード例 #11
0
 public void gotoMenu()
 {
     GLink.sharedInstance().executeMenu();
 }
コード例 #12
0
 public void gotoHome()
 {
     GLink.sharedInstance().executeHome();
 }
コード例 #13
0
 public void OnClickGlinkButton()
 {
     Debug.Log("click!");
     GLink.sharedInstance().executeHomeBanner();
 }