void LoginCallBack(ILoginResult result) { if (FB.IsLoggedIn) { // AccessToken class will have session details var aToken = Facebook.Unity.AccessToken.CurrentAccessToken; // Print current access token's User ID Debug.Log(aToken.UserId); // Print current access token's granted permissions foreach (string perm in aToken.Permissions) { Debug.Log(perm); } GameEventManager.TriggerFBLogin(); //Quest check if (!questChecker.QUEST_FB_LOGIN) { PlayerPrefs.SetBool(Constants.QUEST_FB_LOGIN, true); questChecker.UpdateQuestStatus(); MainDriver.Instance.PostAchievement(Constants.QUEST_FB_LOGIN_ID); MainDriver.Instance.AwardDiamonds(Constants.QUEST_AWARD); } } else { Debug.Log("User cancelled login"); } }
IEnumerator SaveScreenShot() { // create the texture yield return(new WaitForEndOfFrame()); MyImage = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, true); //* 0.38f // put buffer into texture MyImage.ReadPixels(new Rect(0f, 0f, Screen.width, Screen.height), 0, 0); // * 0.8f // apply MyImage.Apply(); yield return(new WaitForEndOfFrame()); byte[] bytes = MyImage.EncodeToPNG(); pathToShareImg = Application.persistentDataPath + "/dbdShare.png"; File.WriteAllBytes(pathToShareImg, bytes); yield return(new WaitForEndOfFrame()); #if UNITY_ANDROID StartCoroutine(Main.Instance.ShareAndroidMedia()); #elif UNITY_IPHONE MainDriver.Instance.ShareIosMedia(); #endif //Check SHare Quest if (!questChecker.ACHIV_SHARE) { PlayerPrefs.SetBool(Constants.QUEST_SHARE, true); questChecker.UpdateQuestStatus(); Main.Instance.PostAchievement(Constants.QUEST_SHARE); } }