// 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); }
public void OnClickGlinkButton() { // GLinkNaverId.sharedInstance().init("197CymaStozo7X5r2qR5", "evCgKH1kJL"); // GLinkNaverId.sharedInstance().login(); GLink.sharedInstance().setWidgetStartPosition(false, 60); GLink.sharedInstance().executeHome(); }
void Start() { GLink.sharedInstance().init(CafeId, NaverLoginClientId, NaverLoginClientSecret); if (SupportGlobal) { GLink.sharedInstance().initGlobal(ConsumerKey, ConsumerSecureKey, CommunityNo, LoungeNo); } }
void Start() { GLink.sharedInstance().init(LoungeId, NaverLoginClientId, NaverLoginClientSecret); GLinkDelegate.sdkCallInGameMenuCode += code => { GLink.sharedInstance().terminateSdk(); Debug.Log("CallInGameMenuCode : " + code); }; }
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); }
public void OnClickGlinkButton() { GLink.sharedInstance().setWidgetStartPosition(false, 60); GLink.sharedInstance().executeHome(); }
public void OnClickGlinkButton() { GLink.sharedInstance().executeHome(); }
public void gotoProfile() { GLink.sharedInstance().executeProfile(); }
public void gotoEvnet() { GLink.sharedInstance().executeEvent(); }
public void gotoNotice() { GLink.sharedInstance().executeNotice(); }
public void gotoMenu() { GLink.sharedInstance().executeMenu(); }
public void gotoHome() { GLink.sharedInstance().executeHome(); }
public void OnClickGlinkButton() { Debug.Log("click!"); GLink.sharedInstance().executeHomeBanner(); }